1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-30 01:49:10 +00:00

(svn r25865) -Codechange: Refactor detecting of depot vehicle type of a tile to a new function, GetDepotVehicleType (cirdan, LordAro)

This commit is contained in:
zuu
2013-10-13 20:11:05 +00:00
parent 12ddbb7cb1
commit cef1c47f18
4 changed files with 20 additions and 22 deletions

View File

@@ -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();