fixed playing time bonus sound in BD engine with R'n'D sound engine
authorHolger Schemel <holger.schemel@virtion.de>
Tue, 17 Dec 2024 19:16:56 +0000 (20:16 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Tue, 17 Dec 2024 18:52:16 +0000 (19:52 +0100)
Without this addition, no time bonus sound is played while counting
down the last few seconds after a game is won, using the native BD
game engine while using the non-native (R'n'D) sound engine.

src/game_bd/bd_caveengine.c

index 01e160c1b007e685840be5bbd4808d688d95613f..ba4aa4c88df7aea180d8390c2951ca276ce2f8fc 100644 (file)
@@ -326,7 +326,14 @@ void gd_cave_set_seconds_sound(GdCave *cave)
   // also skip timeout sounds when not using native sound engine
   if (game_bd.game == NULL || game_bd.game->state_counter != GAME_INT_CHECK_BONUS_TIME ||
       !game.use_native_bd_sound_engine)
+  {
+    // needed to play sound during last seconds of counting bonus time with non-native sounds
+    if (game_bd.game != NULL && game_bd.game->state_counter == GAME_INT_CHECK_BONUS_TIME &&
+        !game.use_native_bd_sound_engine)
+      gd_sound_play(cave, GD_S_FINISHED, O_NONE, -1, -1);
+
     return;
+  }
 
   // this is an integer division, so 0 seconds can be 0.5 seconds...
   // also, when this reaches 8, the player still has 8.9999 seconds.