From: Holger Schemel Date: Sun, 1 Dec 2024 14:50:19 +0000 (+0100) Subject: fixed playing non-native sounds at wrap-around BD cave positions X-Git-Tag: 4.4.0.0-test-4~1 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=daf84901;p=rocksndiamonds.git fixed playing non-native sounds at wrap-around BD cave positions --- diff --git a/src/game_bd/bd_sound.c b/src/game_bd/bd_sound.c index 5468cb72..b139025e 100644 --- a/src/game_bd/bd_sound.c +++ b/src/game_bd/bd_sound.c @@ -494,6 +494,10 @@ void gd_sound_play(GdCave *cave, GdSound sound, GdElement element, int x, int y) if (!game.use_native_bd_sound_engine) { + // fix wrap-around cave positions for non-native sound engine + x = (x + cave->w) % cave->w; + y = (y + cave->h) % cave->h; + // when not using native sound engine, just play the sound PlayLevelSound_BD(x, y, element, sound);