diff options
author | rubidium <rubidium@openttd.org> | 2010-09-08 21:37:13 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-09-08 21:37:13 +0000 |
commit | f5128695c54ad634e1ac45ae4271c1db5ed15fad (patch) | |
tree | 7fe3411110d924b4c2d879f3c32ceb5a0ddd4f00 /src/depot_cmd.cpp | |
parent | 881c6c679ff2606111cb890847147556142c3451 (diff) | |
download | openttd-f5128695c54ad634e1ac45ae4271c1db5ed15fad.tar.xz |
(svn r20772) -Codechange: use packed VehicleListIdentifiers as window numbers
Diffstat (limited to 'src/depot_cmd.cpp')
-rw-r--r-- | src/depot_cmd.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/depot_cmd.cpp b/src/depot_cmd.cpp index bf4d0201c..2c507f73f 100644 --- a/src/depot_cmd.cpp +++ b/src/depot_cmd.cpp @@ -16,6 +16,7 @@ #include "string_func.h" #include "town.h" #include "vehicle_gui.h" +#include "vehiclelist.h" #include "window_func.h" #include "table/strings.h" @@ -71,13 +72,14 @@ CommandCost CmdRenameDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 SetWindowDirty(WC_VEHICLE_DEPOT, d->xy); /* Update the depot list */ - WindowNumber wno = (d->index << 16) | VLW_DEPOT_LIST | GetTileOwner(d->xy); + VehicleType vt; switch (GetTileType(d->xy)) { - default: break; - case MP_RAILWAY: SetWindowDirty(WC_TRAINS_LIST, wno | (VEH_TRAIN << 11)); break; - case MP_ROAD: SetWindowDirty(WC_ROADVEH_LIST, wno | (VEH_ROAD << 11)); break; - case MP_WATER: SetWindowDirty(WC_SHIPS_LIST, wno | (VEH_SHIP << 11)); break; + default: NOT_REACHED(); + case MP_RAILWAY: vt = VEH_TRAIN; break; + case MP_ROAD: vt = VEH_ROAD; break; + case MP_WATER: vt = VEH_SHIP; break; } + SetWindowDirty(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_DEPOT_LIST, vt, GetTileOwner(d->xy), d->index).Pack()); } return CommandCost(); } |