summaryrefslogtreecommitdiff
path: root/src/rail_cmd.cpp
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 /src/rail_cmd.cpp
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 :)
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r--src/rail_cmd.cpp2
1 files changed, 1 insertions, 1 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);