fixed playing diamond sounds at wrap-around BD cave positions
authorHolger Schemel <holger.schemel@virtion.de>
Sun, 8 Dec 2024 17:21:04 +0000 (18:21 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Sun, 8 Dec 2024 17:21:06 +0000 (18:21 +0100)
src/game_bd/bd_caveengine.c

index 6ac86de149e0ef9a4c0609ce8047a443aa0ccf07..38ddc094ca97c18a8e484f22ea611ccd000a374f 100644 (file)
@@ -1172,7 +1172,7 @@ static GdElement player_eat_element(GdCave *cave, const GdElement element, int x
     case O_DIAMOND:
     case O_FLYING_DIAMOND:
       // prevent diamond sounds for O_SKELETON (see below)
-      if (x != -1 && y != -1)
+      if (x != -1 || y != -1)
        gd_sound_play(cave, (element == O_DIAMOND ? GD_S_DIAMOND_COLLECTING :
                             GD_S_FLYING_DIAMOND_COLLECTING), element, x, y);