changed BD engine to match new GDash code (count diamonds)
authorHolger Schemel <holger.schemel@virtion.de>
Tue, 17 Sep 2024 17:01:47 +0000 (19:01 +0200)
committerHolger Schemel <holger.schemel@virtion.de>
Tue, 17 Sep 2024 11:51:05 +0000 (13:51 +0200)
src/game_bd/bd_cave.c

index 1b3e78533f6aed8ec4e5f2647e9e28c7e63b1c83..ac52745651700613c0ca261dc0977fd03eaaece0 100644 (file)
@@ -1296,9 +1296,27 @@ void gd_cave_count_diamonds(GdCave *cave)
   if (cave->diamonds_needed <= 0)
   {
     for (y = 0; y < cave->h; y++)
+    {
       for (x = 0; x < cave->w; x++)
-       if (cave->map[y][x] == O_DIAMOND)
-         cave->diamonds_needed++;
+      {
+        switch (cave->map[y][x])
+        {
+          case O_DIAMOND:
+          case O_DIAMOND_F:
+          case O_FLYING_DIAMOND:
+          case O_FLYING_DIAMOND_F:
+            cave->diamonds_needed++;
+            break;
+
+          case O_SKELETON:
+            cave->diamonds_needed += cave->skeletons_worth_diamonds;
+            break;
+
+          default:
+            break;
+        }
+      }
+    }
 
     // if still below zero, let this be 0, so gate will be open immediately
     if (cave->diamonds_needed < 0)