summaryrefslogtreecommitdiff
path: root/src/depot_cmd.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_cmd.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_cmd.cpp')
-rw-r--r--src/depot_cmd.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/depot_cmd.cpp b/src/depot_cmd.cpp
index 7027554bd..5fb2b2de2 100644
--- a/src/depot_cmd.cpp
+++ b/src/depot_cmd.cpp
@@ -76,13 +76,7 @@ CommandCost CmdRenameDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
SetWindowDirty(WC_VEHICLE_DEPOT, d->xy);
/* Update the depot list */
- VehicleType vt;
- switch (GetTileType(d->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(d->xy);
SetWindowDirty(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_DEPOT_LIST, vt, GetTileOwner(d->xy), d->index).Pack());
}
return CommandCost();