summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-10 11:19:07 +0000
committerrubidium <rubidium@openttd.org>2009-11-10 11:19:07 +0000
commit15ede6b76339b13fb1e27d0914660ea4a5b30ee8 (patch)
treeee28332cc64ae49fdace4e6444329b8a8e4000c1
parent7247011636cd6a0c72c08b5d76717c59a7410237 (diff)
downloadopenttd-15ede6b76339b13fb1e27d0914660ea4a5b30ee8.tar.xz
(svn r18035) -Fix (r16909): one could remotely crash (assert) the server on certain commands
-rw-r--r--src/station_cmd.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 58ffc5ef3..0bb5ff0b9 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -56,6 +56,9 @@ bool IsHangar(TileIndex t)
{
assert(IsTileType(t, MP_STATION));
+ /* If the tile isn't an airport there's no chance it's a hangar. */
+ if (!IsAirport(t)) return false;
+
const Station *st = Station::GetByTile(t);
const AirportFTAClass *apc = st->Airport();