mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 23:50:25 +00:00
Fix: wrong error message when building canals over ship depots / locks
IsTileType() also considers ship depots and locks water. IsWaterTile() does the right thing.
This commit is contained in:
parent
6ce74b2a1b
commit
b335b0501c
@ -475,10 +475,11 @@ CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
return_cmd_error(STR_ERROR_FLAT_LAND_REQUIRED);
|
||||
}
|
||||
|
||||
/* can't make water of water! */
|
||||
if (IsTileType(current_tile, MP_WATER) && (!IsTileOwner(current_tile, OWNER_WATER) || wc == WATER_CLASS_SEA)) continue;
|
||||
|
||||
bool water = IsWaterTile(current_tile);
|
||||
|
||||
/* can't make water of water! */
|
||||
if (water && (!IsTileOwner(current_tile, OWNER_WATER) || wc == WATER_CLASS_SEA)) continue;
|
||||
|
||||
ret = DoCommand(current_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
|
||||
if (ret.Failed()) return ret;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user