From 139c6c7cb06bbd952ff74454722de5a39560f564 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 17 Sep 2024 19:01:47 +0200 Subject: [PATCH] changed BD engine to match new GDash code (count diamonds) --- src/game_bd/bd_cave.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/game_bd/bd_cave.c b/src/game_bd/bd_cave.c index 1b3e7853..ac527456 100644 --- a/src/game_bd/bd_cave.c +++ b/src/game_bd/bd_cave.c @@ -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) -- 2.34.1