fixed crash bug
authorHolger Schemel <holger.schemel@virtion.de>
Tue, 3 Dec 2024 18:07:27 +0000 (19:07 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Tue, 3 Dec 2024 13:07:59 +0000 (14:07 +0100)
src/game_bd/bd_gameplay.c
src/game_bd/bd_sound.c
src/game_bd/bd_sound.h

index eef5ddaeccc42c5f73472760e0ba012cc12b0788..39c73835e45d59e92c79474a3712c7955fc93106 100644 (file)
@@ -52,7 +52,7 @@ static void add_bonus_life(GdGame *game, boolean inform_user)
 {
   if (inform_user)
   {
-    gd_sound_play_bonus_life();
+    gd_sound_play_bonus_life(game->cave);
     game->bonus_life_flash = 100;
   }
 
index b139025e1cc03c96bb98c3dca6a7e8e5b4f00d71..dd42357eb48735cf7e012b8d20163d22cf992289 100644 (file)
@@ -381,10 +381,10 @@ void gd_sound_off(void)
     halt_channel(i);
 }
 
-void gd_sound_play_bonus_life(void)
+void gd_sound_play_bonus_life(GdCave *cave)
 {
   // required to set extended sound information for native sound engine
-  gd_sound_play(NULL, GD_S_BONUS_LIFE, O_NONE, -1, -1);
+  gd_sound_play(cave, GD_S_BONUS_LIFE, O_NONE, -1, -1);
 
   // now play the sound directly (on non-standard sound channel)
   play_sound(gd_sound_get_channel(GD_S_BONUS_LIFE), GD_S_BONUS_LIFE);
index ccce604b5ca855dc2bb334316bd97a0e96b9f130..99a6aee00b1e1a5ab2c0db85bc55e326bd631aea 100644 (file)
@@ -24,7 +24,7 @@
 void gd_sound_init(void);
 void gd_sound_off(void);
 void gd_sound_play_cave(GdCave *cave);
-void gd_sound_play_bonus_life(void);
+void gd_sound_play_bonus_life(GdCave *cave);
 void gd_sound_play(GdCave *cave, GdSound sound, GdElement element, int x, int y);
 
 #endif // BD_SOUND_H