added playing "game.losing" sound effect for all game engines
[rocksndiamonds.git] / src / game.c
index edf9686c4158e8f42c0f31cc65bfa38f55cef42b..49874ed7a437dbf6d2d1ac380eb90708d698cd6a 100644 (file)
@@ -11904,7 +11904,7 @@ static void GameActionsExt(void)
     TapeRecordAction(tape_action);
 
   // remember if game was played (especially after tape stopped playing)
-  if (!tape.playing && summarized_player_action)
+  if (!tape.playing && summarized_player_action && !checkGameFailed())
     game.GamePlayed = TRUE;
 
 #if USE_NEW_PLAYER_ASSIGNMENTS
@@ -13998,7 +13998,6 @@ void BuryPlayer(struct PlayerInfo *player)
     return;
 
   PlayLevelSoundElementAction(jx, jy, player->artwork_element, ACTION_DYING);
-  PlayLevelSound(jx, jy, SND_GAME_LOSING);
 
   RemovePlayer(player);
 
@@ -14656,7 +14655,7 @@ static int DigField(struct PlayerInfo *player,
 
        LevelSolved();
 
-       PlayLevelSound(x, y, SND_GAME_SOKOBAN_SOLVING);
+       PlaySound(SND_GAME_SOKOBAN_SOLVING);
       }
     }
     else
@@ -15681,6 +15680,9 @@ void CheckGameOver(void)
 
   if (game_over_delay > 0)
   {
+    if (game_over_delay == game_over_delay_value)
+      PlaySound(SND_GAME_LOSING);
+
     game_over_delay--;
 
     return;