(svn r9524) -Fix(FS#640,r8755): Implemented a "dummy" State Machine for stations who got their airport removed while there were still aircraft within the State Machine (and thus caused asserts)

This commit is contained in:
celestar
2007-03-29 13:52:34 +00:00
parent 34272ad201
commit 4ad4f1f3f1
6 changed files with 100 additions and 52 deletions

View File

@@ -1600,6 +1600,13 @@ static int32 RemoveAirport(Station *st, uint32 flags)
int32 cost = w * h * _price.remove_airport;
Vehicle *v;
FOR_ALL_VEHICLES(v) {
if (!(v->type == VEH_AIRCRAFT && IsNormalAircraft(v))) continue;
if (v->u.air.targetairport == st->index && v->u.air.state != FLYING) return CMD_ERROR;
}
BEGIN_TILE_LOOP(tile_cur, w, h, tile) {
if (!EnsureNoVehicle(tile_cur)) return CMD_ERROR;