From: Holger Schemel Date: Tue, 17 Sep 2024 17:01:47 +0000 (+0200) Subject: changed BD engine to match new GDash code (count diamonds) X-Git-Tag: 4.4.0.0-test-4~221 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=139c6c7cb06bbd952ff74454722de5a39560f564;p=rocksndiamonds.git changed BD engine to match new GDash code (count diamonds) --- 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)