diff options
author | celestar <celestar@openttd.org> | 2007-03-29 13:52:34 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2007-03-29 13:52:34 +0000 |
commit | a1ab0d29fe5d5f0e5b90cc0908837f6b301d32f7 (patch) | |
tree | 37ea5878b75e7b5f0193b94c6d3c2aa3e1e9b498 /src/station_cmd.cpp | |
parent | 386e298acd7855feb54d7b75ce0e3144db487649 (diff) | |
download | openttd-a1ab0d29fe5d5f0e5b90cc0908837f6b301d32f7.tar.xz |
(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)
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 6341fd7df..00f77d44f 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -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; |