(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

@@ -44,12 +44,6 @@ Depot::~Depot()
DeleteWindowById(WC_VEHICLE_DEPOT, this->xy);
/* Delete the depot list */
VehicleType vt;
switch (GetTileType(this->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(this->xy);
DeleteWindowById(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_DEPOT_LIST, vt, GetTileOwner(this->xy), this->index).Pack());
}