From daf84901d01bf1cf96623f2486272b4dd45759ff Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 1 Dec 2024 15:50:19 +0100 Subject: [PATCH] fixed playing non-native sounds at wrap-around BD cave positions --- src/game_bd/bd_sound.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.34.1