542570 has references to subterranean gate, it attempts to link zones using subterranean gates.
Monster generation is called twice, one for each end of subterranean gate.
Failed condition example of sub_00542570:
The second condition you show is a check on whether the vector is populated.... if empty, failure.
i.e.
Cannot create a link between two zones with Subterranean gate
1- same Z level
2 - terrain is water (this condition is also used when linking through monoliths)
In other words, it seems like process to link 2 zones is (over simplified)
1 - try to link with regular path
2 - try to link with boat
3 - try to link with subterranean gate
4- try to link using monoliths
Here I forced sub_00541630 to always fail, and all zones are linked by monoliths or subterranean gates:
(no water)
Now a random map with water, still forcing 541630 to fail
Shipyards are here, but 0 land connection.
Finally another random map with water, but now I also force sub_541FC0 to fail
I can assure you there is 0 shipyard on this one)
... only linked by Subterranean gates and monoliths.
If I force all three of these to fail, zones are linked only by monoliths.