Changeset - r26527:496a60758268
[Not reviewed]
master
0 1 0
SamuXarick - 2 years ago 2022-11-08 20:04:14
43006711+SamuXarick@users.noreply.github.com
Change: Allow to build dock on clearable watered object tiles (#8514)
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -2500,7 +2500,7 @@ CommandCost CmdBuildDock(DoCommandFlag f
 

	
 
	TileIndex tile_cur = tile + TileOffsByDiagDir(direction);
 

	
 
	if (!IsTileType(tile_cur, MP_WATER) || !IsTileFlat(tile_cur)) {
 
	if (!HasTileWaterGround(tile_cur) || !IsTileFlat(tile_cur)) {
 
		return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
 
	}
 

	
 
@@ -2509,8 +2509,10 @@ CommandCost CmdBuildDock(DoCommandFlag f
 
	/* Get the water class of the water tile before it is cleared.*/
 
	WaterClass wc = GetWaterClass(tile_cur);
 

	
 
	bool add_cost = !IsWaterTile(tile_cur);
 
	ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile_cur);
 
	if (ret.Failed()) return ret;
 
	if (add_cost) cost.AddCost(ret);
 

	
 
	tile_cur += TileOffsByDiagDir(direction);
 
	if (!IsTileType(tile_cur, MP_WATER) || !IsTileFlat(tile_cur)) {
0 comments (0 inline, 0 general)