summaryrefslogtreecommitdiff
path: root/src/road_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-05-26 23:18:42 +0000
committerrubidium <rubidium@openttd.org>2007-05-26 23:18:42 +0000
commitc69458d894a4db6e4d5c19dabde204ddf5dec3f9 (patch)
tree170ca27dde12587beba547b98e7e705a50a53a56 /src/road_cmd.cpp
parent35f1299d40b8ec24fde84db1a39b55e6603205bb (diff)
downloadopenttd-c69458d894a4db6e4d5c19dabde204ddf5dec3f9.tar.xz
(svn r9949) -Fix: (road) depots got deowned on bankrupts.
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r--src/road_cmd.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 2f51656bb..1d1eace2c 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -1284,10 +1284,12 @@ static uint32 VehicleEnter_Road(Vehicle *v, TileIndex tile, int x, int y)
static void ChangeTileOwner_Road(TileIndex tile, PlayerID old_player, PlayerID new_player)
{
if (GetRoadTileType(tile) == ROAD_TILE_DEPOT) {
- if (new_player == PLAYER_SPECTATOR) {
- DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
- } else {
- SetTileOwner(tile, new_player);
+ if (GetTileOwner(tile) == old_player) {
+ if (new_player == PLAYER_SPECTATOR) {
+ DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
+ } else {
+ SetTileOwner(tile, new_player);
+ }
}
return;
}