File diff r8367:dad834c921b1 → r8368:229f823c854a
src/water_cmd.cpp
Show inline comments
 
@@ -53,13 +53,13 @@ void MakeWaterOrCanalDependingOnSurround
 

	
 
	/* Mark tile dirty in all cases */
 
	MarkTileDirtyByTile(t);
 

	
 
	/* Non-sealevel -> canal */
 
	if (TileHeight(t) != 0) {
 
		MakeCanal(t, o);
 
		MakeCanal(t, o, Random());
 
		return;
 
	}
 

	
 
	bool has_water = false;
 
	bool has_canal = false;
 

	
 
@@ -68,13 +68,13 @@ void MakeWaterOrCanalDependingOnSurround
 
		if (IsTileType(neighbour, MP_WATER)) {
 
			has_water |= IsSea(neighbour) || IsCoast(neighbour) || (IsShipDepot(neighbour) && GetShipDepotWaterOwner(neighbour) == OWNER_WATER);
 
			has_canal |= IsCanal(neighbour) || (IsShipDepot(neighbour) && GetShipDepotWaterOwner(neighbour) != OWNER_WATER);
 
		}
 
	}
 
	if (has_canal || !has_water) {
 
		MakeCanal(t, o);
 
		MakeCanal(t, o, Random());
 
	} else {
 
		MakeWater(t);
 
	}
 
}
 

	
 

	
 
@@ -125,13 +125,13 @@ CommandCost CmdBuildShipDepot(TileIndex 
 

	
 
void MakeWaterOrCanalDependingOnOwner(TileIndex tile, Owner o)
 
{
 
	if (o == OWNER_WATER) {
 
		MakeWater(tile);
 
	} else {
 
		MakeCanal(tile, o);
 
		MakeCanal(tile, o, Random());
 
	}
 
}
 

	
 
static CommandCost RemoveShipDepot(TileIndex tile, uint32 flags)
 
{
 
	TileIndex tile2;
 
@@ -302,15 +302,15 @@ CommandCost CmdBuildCanal(TileIndex tile
 
		cost.AddCost(ret);
 

	
 
		if (flags & DC_EXEC) {
 
			if (TileHeight(tile) == 0 && p2 == 1) {
 
				MakeWater(tile);
 
			} else if (p2 == 2) {
 
				MakeRiver(tile);
 
				MakeRiver(tile, Random());
 
			} else {
 
				MakeCanal(tile, _current_player);
 
				MakeCanal(tile, _current_player, Random());
 
			}
 
			MarkTileDirtyByTile(tile);
 
			MarkTilesAroundDirty(tile);
 
		}
 

	
 
		cost.AddCost(_price.clear_water);