Changeset - r25969:ecbd8fecb7f6
[Not reviewed]
master
0 1 0
SamuXarick - 3 years ago 2021-09-18 10:46:20
43006711+SamuXarick@users.noreply.github.com
Fix: wrong error message when building canals over ship depots / locks

IsTileType() also considers ship depots and locks water. IsWaterTile() does the right thing.
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/water_cmd.cpp
Show inline comments
 
@@ -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;
 

	
0 comments (0 inline, 0 general)