diff options
author | tron <tron@openttd.org> | 2005-01-29 14:53:05 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-01-29 14:53:05 +0000 |
commit | 5a6ec81e7f6be2d14550b4a4e50b8586e2d3801e (patch) | |
tree | 8d29f84df6fcdbd3fd221da9b4f1652900449cab | |
parent | e86e9f96ca34114d53d4909ce2d6aa2d83dde2eb (diff) | |
download | openttd-5a6ec81e7f6be2d14550b4a4e50b8586e2d3801e.tar.xz |
(svn r1716) Prevent zeppelins from accessing non-existent tiles when leaving the map
-rw-r--r-- | disaster_cmd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/disaster_cmd.c b/disaster_cmd.c index e7d5f2393..bd3955a9c 100644 --- a/disaster_cmd.c +++ b/disaster_cmd.c @@ -171,7 +171,8 @@ static void DisasterTick_Zeppeliner(Vehicle *v) } else if (v->current_order.station == 0) { tile = v->tile; /**/ - if (IsTileType(tile, MP_STATION) && + if (IsValidTile(tile) && + IsTileType(tile, MP_STATION) && IS_BYTE_INSIDE(_map5[tile], 8, 0x43) && IS_HUMAN_PLAYER(_map_owner[tile])) { @@ -196,7 +197,8 @@ static void DisasterTick_Zeppeliner(Vehicle *v) tile = v->tile; /**/ - if (IsTileType(tile, MP_STATION) && + if (IsValidTile(tile) && + IsTileType(tile, MP_STATION) && IS_BYTE_INSIDE(_map5[tile], 8, 0x43) && IS_HUMAN_PLAYER(_map_owner[tile])) { @@ -238,7 +240,8 @@ static void DisasterTick_Zeppeliner(Vehicle *v) } tile = v->tile;/**/ - if (IsTileType(tile, MP_STATION) && + if (IsValidTile(tile) && + IsTileType(tile, MP_STATION) && IS_BYTE_INSIDE(_map5[tile], 8, 0x43) && IS_HUMAN_PLAYER(_map_owner[tile])) { |