summaryrefslogtreecommitdiff
path: root/src/sound.cpp
diff options
context:
space:
mode:
authorYexo <yexo@openttd.org>2009-01-21 02:31:55 +0000
committerYexo <yexo@openttd.org>2009-01-21 02:31:55 +0000
commitdb3ee34b4468aa3448b64e339258760885c5d716 (patch)
tree272533ac91b7bc3ab16c3ee1a997e142f3170a2a /src/sound.cpp
parent5e7669b539002cb9ec9e608f4601a827b5e9da57 (diff)
downloadopenttd-db3ee34b4468aa3448b64e339258760885c5d716.tar.xz
(svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map.
Diffstat (limited to 'src/sound.cpp')
-rw-r--r--src/sound.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sound.cpp b/src/sound.cpp
index cd795560d..429710f66 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -237,8 +237,8 @@ static void SndPlayScreenCoordFx(SoundFx sound, int left, int right, int top, in
void SndPlayTileFx(SoundFx sound, TileIndex tile)
{
/* emits sound from center of the tile */
- int x = TileX(tile) * TILE_SIZE + TILE_SIZE / 2;
- int y = TileY(tile) * TILE_SIZE - TILE_SIZE / 2;
+ int x = min(MapMaxX() - 1, TileX(tile)) * TILE_SIZE + TILE_SIZE / 2;
+ int y = min(MapMaxY() - 1, TileY(tile)) * TILE_SIZE - TILE_SIZE / 2;
uint z = (y < 0 ? 0 : GetSlopeZ(x, y));
Point pt = RemapCoords(x, y, z);
y += 2 * TILE_SIZE;