fixed bug with looping death sound when killed by voodoo in BD engine
authorHolger Schemel <holger.schemel@virtion.de>
Sat, 18 Jan 2025 11:28:15 +0000 (12:28 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Sat, 18 Jan 2025 11:28:19 +0000 (12:28 +0100)
src/game_bd/bd_caveengine.c

index 7e79685e4ccec6f336c3d9b57541c184eee82f6d..17acfafca0f1edcc22d350bde178b3afdfdbf281 100644 (file)
@@ -4168,9 +4168,10 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire,
   if (cave->kill_player ||
       (cave->player_state == GD_PL_LIVING && cave->player_seen_ago > cave->player_seen_ago_limit))
   {
-    cave->player_state = GD_PL_DIED;
+    if (cave->player_state != GD_PL_DIED)
+      gd_sound_play(cave, GD_S_DYING, O_PLAYER, -1, -1);
 
-    gd_sound_play(cave, GD_S_DYING, O_PLAYER, -1, -1);
+    cave->player_state = GD_PL_DIED;
   }
 
   // check if any voodoo exploded, and kill players the next scan if that happended.