summaryrefslogtreecommitdiff
path: root/src
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
commitf044ef6564d5bc9f4cfbc98823cd898105a39a18 (patch)
treea45275c9d8eca486dae898a689c3671517218de0 /src
parent7bbdd4f1196170b4abec8d5b1a2ccf6fad324d19 (diff)
downloadopenttd-f044ef6564d5bc9f4cfbc98823cd898105a39a18.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.
Diffstat (limited to 'src')
-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;