summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-09-07 08:35:45 +0000
committerrubidium <rubidium@openttd.org>2009-09-07 08:35:45 +0000
commit130781102e2627adb3b8709d878f45b6ddfa7cab (patch)
treee3fffb5c0a1691c0728a38fb4c20622efad82f07
parent6593e4490a4175e3b533e6686a4d1e4131668b9e (diff)
downloadopenttd-130781102e2627adb3b8709d878f45b6ddfa7cab.tar.xz
(svn r17443) -Fix (r17442): clear the depot tile after removing the depot in all cases instead of only for ships; makes removing road/rail depots not crash :)
-rw-r--r--src/rail_cmd.cpp2
-rw-r--r--src/road_cmd.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 24792baab..ba288b946 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -1442,8 +1442,8 @@ static CommandCost RemoveTrainDepot(TileIndex tile, DoCommandFlag flags)
if (v != NULL) FreeTrainTrackReservation(v);
}
- DoClearSquare(tile);
delete Depot::GetByTile(tile);
+ DoClearSquare(tile);
AddSideToSignalBuffer(tile, dir, owner);
YapfNotifyTrackLayoutChange(tile, DiagDirToDiagTrack(dir));
if (v != NULL) TryPathReserve(v, true);
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 754d6fd97..d3c865e35 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -895,8 +895,8 @@ static CommandCost RemoveRoadDepot(TileIndex tile, DoCommandFlag flags)
if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
if (flags & DC_EXEC) {
- DoClearSquare(tile);
delete Depot::GetByTile(tile);
+ DoClearSquare(tile);
}
return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_road_depot);