(svn r21939) -Fix (r16357): the check for valid depot wasn't strict enough

This commit is contained in:
smatz
2011-02-02 14:50:57 +00:00
parent 0ebc548a89
commit b15719bbd2
2 changed files with 11 additions and 3 deletions

View File

@@ -28,6 +28,11 @@ Depot::~Depot()
{
if (CleaningPool()) return;
if (!IsDepotTile(this->xy) || GetDepotIndex(this->xy) != this->index) {
/* It can happen there is no depot here anymore (TTO/TTD savegames) */
return;
}
/* Clear the order backup. */
OrderBackup::Reset(this->xy, false);
@@ -40,7 +45,7 @@ Depot::~Depot()
/* Delete the depot list */
VehicleType vt;
switch (GetTileType(this->xy)) {
default: return; // It can happen there is no depot here anymore (TTO/TTD savegames)
default: NOT_REACHED();
case MP_RAILWAY: vt = VEH_TRAIN; break;
case MP_ROAD: vt = VEH_ROAD; break;
case MP_WATER: vt = VEH_SHIP; break;