summaryrefslogtreecommitdiff
path: root/src/depot.cpp
diff options
context:
space:
mode:
authorzuu <zuu@openttd.org>2013-10-13 20:11:05 +0000
committerzuu <zuu@openttd.org>2013-10-13 20:11:05 +0000
commitcef1c47f18591678fbe4df4e0f343b6561cb6b01 (patch)
tree7370f95304dec517a7937ffcc0d75770d7ba2658 /src/depot.cpp
parent12ddbb7cb11ddeba47a6bed8d36bef6432aa3236 (diff)
downloadopenttd-cef1c47f18591678fbe4df4e0f343b6561cb6b01.tar.xz
(svn r25865) -Codechange: Refactor detecting of depot vehicle type of a tile to a new function, GetDepotVehicleType (cirdan, LordAro)
Diffstat (limited to 'src/depot.cpp')
-rw-r--r--src/depot.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/depot.cpp b/src/depot.cpp
index 4fb69c8e3..9663f042e 100644
--- a/src/depot.cpp
+++ b/src/depot.cpp
@@ -44,12 +44,6 @@ Depot::~Depot()
DeleteWindowById(WC_VEHICLE_DEPOT, this->xy);
/* Delete the depot list */
- VehicleType vt;
- switch (GetTileType(this->xy)) {
- default: NOT_REACHED();
- case MP_RAILWAY: vt = VEH_TRAIN; break;
- case MP_ROAD: vt = VEH_ROAD; break;
- case MP_WATER: vt = VEH_SHIP; break;
- }
+ VehicleType vt = GetDepotVehicleType(this->xy);
DeleteWindowById(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_DEPOT_LIST, vt, GetTileOwner(this->xy), this->index).Pack());
}