# HG changeset patch # User smatz # Date 1203443130 0 # Node ID a68061bad214d775156e72caed72b14862810e3e # Parent b547d33e53d8540cef47f2fbf982f7d800df9255 (svn r12186) -Fix [FS#1784](r12169): assert when trying to play tile sound at NW border of map (placing buyos, leveling land) diff -r b547d33e53d8 -r a68061bad214 src/sound.cpp --- a/src/sound.cpp Mon Feb 18 23:37:16 2008 +0000 +++ b/src/sound.cpp Tue Feb 19 17:45:30 2008 +0000 @@ -241,7 +241,8 @@ /* 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; - Point pt = RemapCoords(x, y, GetSlopeZ(x, y)); + uint z = (y < 0 ? 0 : GetSlopeZ(x, y)); + Point pt = RemapCoords(x, y, z); y += 2 * TILE_SIZE; Point pt2 = RemapCoords(x, y, GetSlopeZ(x, y)); SndPlayScreenCoordFx(sound, pt.x, pt2.x, pt.y, pt2.y);