From: Holger Schemel Date: Sat, 14 Dec 2024 17:18:25 +0000 (+0100) Subject: fixed playing loop sounds when using native BD game engine X-Git-Tag: 4.4.0.0-test-6~3 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=4c8fe1a3afdbe4c3188db6ebe23b768027d59456;p=rocksndiamonds.git fixed playing loop sounds when using native BD game engine When using the native BD game engine, but not using the native BD sound engine, loop sounds were not played anymore due to a bug with off-playfield sound positions. This bug was introduced by commit 386e26cf. --- diff --git a/src/game_bd/bd_sound.c b/src/game_bd/bd_sound.c index 55654f2c..794610c4 100644 --- a/src/game_bd/bd_sound.c +++ b/src/game_bd/bd_sound.c @@ -478,9 +478,12 @@ static void gd_sound_info_to_play(int channel, int x, int y, int element, int so // plays sound in a cave void gd_sound_play(GdCave *cave, GdSound sound, GdElement element, int x, int y) { - // fix wrap-around cave positions - x = (x + cave->w) % cave->w; - y = (y + cave->h) % cave->h; + if (x != -1 || y != -1) + { + // fix wrap-around cave positions + x = (x + cave->w) % cave->w; + y = (y + cave->h) % cave->h; + } if (sound == GD_S_NONE) return;