fixed bug with playing two global game sounds as game element sounds
authorHolger Schemel <info@artsoft.org>
Sun, 12 Mar 2023 12:17:40 +0000 (13:17 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 12 Mar 2023 12:25:53 +0000 (13:25 +0100)
The two game sounds "game.losing" and "game.sokoban_solving" were
played as playfield position related, game element specific sounds
before (which especially caused problems with "game.losing" being
defined as a loop sound, but which was stopped after a very short
time, because loop sounds have to be regularly re-initiated to keep
playing, which was not the case here).

As a result, the sound effect "game.losing" (an evil laughter after
the player has died) could effectively not be heard anymore after a
game was lost for many years.

src/game.c

index a2afc3e3cb157c61f468c2a71132609667895563..8d713df727b83175c5b3a6a0f500fa1d0b76c632 100644 (file)
@@ -13998,7 +13998,8 @@ void BuryPlayer(struct PlayerInfo *player)
     return;
 
   PlayLevelSoundElementAction(jx, jy, player->artwork_element, ACTION_DYING);
-  PlayLevelSound(jx, jy, SND_GAME_LOSING);
+
+  PlaySound(SND_GAME_LOSING);
 
   RemovePlayer(player);
 
@@ -14656,7 +14657,7 @@ static int DigField(struct PlayerInfo *player,
 
        LevelSolved();
 
-       PlayLevelSound(x, y, SND_GAME_SOKOBAN_SOLVING);
+       PlaySound(SND_GAME_SOKOBAN_SOLVING);
       }
     }
     else