summaryrefslogtreecommitdiff
path: root/src/water_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-07-16 21:00:40 +0000
committerrubidium <rubidium@openttd.org>2007-07-16 21:00:40 +0000
commita58a18bb5065ea09932bdb2d78ea41d314333e70 (patch)
tree738ab2f5857d1a88e75db7dd1cfdac8152966060 /src/water_cmd.cpp
parent3cf51c61885ef4acc60e4e193ab06a4038389c38 (diff)
downloadopenttd-a58a18bb5065ea09932bdb2d78ea41d314333e70.tar.xz
(svn r10593) -Fix [FS#1038]: one could not remove locks that were build in a (very) old version of OpenTTD.
Diffstat (limited to 'src/water_cmd.cpp')
-rw-r--r--src/water_cmd.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index e8d201c3a..a15c3b96f 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -169,7 +169,7 @@ static CommandCost RemoveShiplift(TileIndex tile, uint32 flags)
{
TileIndexDiff delta = TileOffsByDiagDir(GetLockDirection(tile));
- if (!CheckTileOwnership(tile)) return CMD_ERROR;
+ if (!CheckTileOwnership(tile) && GetTileOwner(tile) != OWNER_NONE) return CMD_ERROR;
/* make sure no vehicle is on the tile. */
if (!EnsureNoVehicle(tile) || !EnsureNoVehicle(tile + delta) || !EnsureNoVehicle(tile - delta))
@@ -296,7 +296,7 @@ static CommandCost ClearTile_Water(TileIndex tile, byte flags)
return_cmd_error(STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP);
}
- if (GetTileOwner(tile) != OWNER_WATER && !CheckTileOwnership(tile)) return CMD_ERROR;
+ if (GetTileOwner(tile) != OWNER_WATER && GetTileOwner(tile) != OWNER_NONE && !CheckTileOwnership(tile)) return CMD_ERROR;
if (flags & DC_EXEC) DoClearSquare(tile);
return CommandCost(_price.clear_water);
@@ -798,8 +798,10 @@ static void ChangeTileOwner_Water(TileIndex tile, PlayerID old_player, PlayerID
if (new_player != PLAYER_SPECTATOR) {
SetTileOwner(tile, new_player);
- } else {
+ } else if (IsShipDepot(tile)) {
DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
+ } else {
+ SetTileOwner(tile, OWNER_NONE);
}
}