From: Holger Schemel Date: Tue, 3 Dec 2024 18:07:27 +0000 (+0100) Subject: fixed crash bug X-Git-Tag: 4.4.0.0-test-5~21 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=10a3af0233f8081f63055b8ba4e9d3b0f7b3e854;p=rocksndiamonds.git fixed crash bug --- diff --git a/src/game_bd/bd_gameplay.c b/src/game_bd/bd_gameplay.c index eef5ddae..39c73835 100644 --- a/src/game_bd/bd_gameplay.c +++ b/src/game_bd/bd_gameplay.c @@ -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; } diff --git a/src/game_bd/bd_sound.c b/src/game_bd/bd_sound.c index b139025e..dd42357e 100644 --- a/src/game_bd/bd_sound.c +++ b/src/game_bd/bd_sound.c @@ -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); diff --git a/src/game_bd/bd_sound.h b/src/game_bd/bd_sound.h index ccce604b..99a6aee0 100644 --- a/src/game_bd/bd_sound.h +++ b/src/game_bd/bd_sound.h @@ -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