# HG changeset patch # User SamuXarick <43006711+SamuXarick@users.noreply.github.com> # Date 2021-09-18 10:46:20 # Node ID ecbd8fecb7f6c4bc66b834fda150b406c088c889 # Parent 3a653e5d36856794fad71bc8f8a11c5a5517ba2c Fix: wrong error message when building canals over ship depots / locks IsTileType() also considers ship depots and locks water. IsWaterTile() does the right thing. diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -475,10 +475,11 @@ CommandCost CmdBuildCanal(TileIndex tile return_cmd_error(STR_ERROR_FLAT_LAND_REQUIRED); } + bool water = IsWaterTile(current_tile); + /* can't make water of water! */ - if (IsTileType(current_tile, MP_WATER) && (!IsTileOwner(current_tile, OWNER_WATER) || wc == WATER_CLASS_SEA)) continue; + if (water && (!IsTileOwner(current_tile, OWNER_WATER) || wc == WATER_CLASS_SEA)) continue; - bool water = IsWaterTile(current_tile); ret = DoCommand(current_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); if (ret.Failed()) return ret;