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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user