summaryrefslogtreecommitdiff
path: root/src/depot.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-09-08 21:37:13 +0000
committerrubidium <rubidium@openttd.org>2010-09-08 21:37:13 +0000
commitf5128695c54ad634e1ac45ae4271c1db5ed15fad (patch)
tree7fe3411110d924b4c2d879f3c32ceb5a0ddd4f00 /src/depot.cpp
parent881c6c679ff2606111cb890847147556142c3451 (diff)
downloadopenttd-f5128695c54ad634e1ac45ae4271c1db5ed15fad.tar.xz
(svn r20772) -Codechange: use packed VehicleListIdentifiers as window numbers
Diffstat (limited to 'src/depot.cpp')
-rw-r--r--src/depot.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/depot.cpp b/src/depot.cpp
index 039ab5b34..a1893c8ef 100644
--- a/src/depot.cpp
+++ b/src/depot.cpp
@@ -16,6 +16,7 @@
#include "window_func.h"
#include "core/pool_func.hpp"
#include "vehicle_gui.h"
+#include "vehiclelist.h"
DepotPool _depot_pool("Depot");
INSTANTIATE_POOL_METHODS(Depot)
@@ -37,13 +38,14 @@ Depot::~Depot()
DeleteWindowById(WC_VEHICLE_DEPOT, this->xy);
/* Delete the depot list */
- WindowNumber wno = (this->index << 16) | VLW_DEPOT_LIST | GetTileOwner(this->xy);
+ VehicleType vt;
switch (GetTileType(this->xy)) {
- default: break; // It can happen there is no depot here anymore (TTO/TTD savegames)
- case MP_RAILWAY: DeleteWindowById(WC_TRAINS_LIST, wno | (VEH_TRAIN << 11)); break;
- case MP_ROAD: DeleteWindowById(WC_ROADVEH_LIST, wno | (VEH_ROAD << 11)); break;
- case MP_WATER: DeleteWindowById(WC_SHIPS_LIST, wno | (VEH_SHIP << 11)); break;
+ default: return; // It can happen there is no depot here anymore (TTO/TTD savegames)
+ case MP_RAILWAY: vt = VEH_TRAIN; break;
+ case MP_ROAD: vt = VEH_ROAD; break;
+ case MP_WATER: vt = VEH_SHIP; break;
}
+ DeleteWindowById(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_DEPOT_LIST, vt, GetTileOwner(this->xy), this->index).Pack());
}
void InitializeDepots()