Feature: Draw infinite water when all borders are water (#13289)

This commit is contained in:
Tyler Trahan
2025-09-26 10:37:27 -04:00
committed by dP
parent e6a05f57e0
commit 25ad0317fb
11 changed files with 105 additions and 24 deletions

View File

@@ -253,6 +253,11 @@ CommandCost CmdBuildObject(DoCommandFlags flags, TileIndex tile, ObjectType type
Owner o = GetTileOwner(t);
if (o != OWNER_NONE && o != OWNER_WATER) cost.AddCost(CheckOwnership(o, t));
/* If freeform edges are disabled, don't allow building on edge tiles. */
if (!_settings_game.construction.freeform_edges && (!IsInsideMM(TileX(t), 1, Map::MaxX() - 1) || !IsInsideMM(TileY(t), 1, Map::MaxY() - 1))) {
return CommandCost(STR_ERROR_TOO_CLOSE_TO_EDGE_OF_MAP);
}
/* However, the tile has to be clear of vehicles. */
cost.AddCost(EnsureNoVehicleOnGround(t));
}