summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-16 23:23:33 +0000
committerrubidium <rubidium@openttd.org>2009-03-16 23:23:33 +0000
commit1323e946076deadad10465ed536a3a6e03e3a8db (patch)
treea45275c9d8eca486dae898a689c3671517218de0
parent72a9d62638ec8081b3c87b3d0ac7d7b48988dae3 (diff)
downloadopenttd-1323e946076deadad10465ed536a3a6e03e3a8db.tar.xz
(svn r15748) -Fix (r1722): the assumption that the number of tiles on the X side equals the number of tiles on the Y side does not hold anymore. As a result of this submarines could be created far outside of the map. Later in r15733 we would test whether that tile would be a water tile and we'd find out the tile isn't within the map.
-rw-r--r--src/disaster_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/disaster_cmd.cpp b/src/disaster_cmd.cpp
index 98cfe8692..87002eb24 100644
--- a/src/disaster_cmd.cpp
+++ b/src/disaster_cmd.cpp
@@ -885,7 +885,7 @@ static void Disaster_Submarine_Init(DisasterSubType subtype)
int x = TileX(r) * TILE_SIZE + TILE_SIZE / 2;
if (HasBit(r, 31)) {
- y = MapMaxX() * TILE_SIZE - TILE_SIZE / 2 - 1;
+ y = MapMaxY() * TILE_SIZE - TILE_SIZE / 2 - 1;
dir = DIR_NW;
} else {
y = TILE_SIZE / 2;