summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-29 14:53:05 +0000
committertron <tron@openttd.org>2005-01-29 14:53:05 +0000
commit5a6ec81e7f6be2d14550b4a4e50b8586e2d3801e (patch)
tree8d29f84df6fcdbd3fd221da9b4f1652900449cab
parente86e9f96ca34114d53d4909ce2d6aa2d83dde2eb (diff)
downloadopenttd-5a6ec81e7f6be2d14550b4a4e50b8586e2d3801e.tar.xz
(svn r1716) Prevent zeppelins from accessing non-existent tiles when leaving the map
-rw-r--r--disaster_cmd.c9
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])) {