From 278196b1b8a46ae3e3b0e768202760ff496ac3c5 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 8 Apr 2023 13:24:34 +0200 Subject: [PATCH] added supporting reference elements for custom element explosion content --- src/game.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/game.c b/src/game.c index 666d992d..6473b49a 100644 --- a/src/game.c +++ b/src/game.c @@ -5838,6 +5838,8 @@ static void Explode(int ex, int ey, int phase, int mode) if (phase == EX_PHASE_START) // initialize 'Store[][]' field { int center_element = Tile[ex][ey]; + int ce_value = CustomValue[ex][ey]; + int ce_score = element_info[center_element].collect_score; int artwork_element, explosion_element; // set these values later // remove things displayed in background while burning dynamite @@ -5976,6 +5978,14 @@ static void Explode(int ex, int ey, int phase, int mode) else Store[x][y] = EL_EMPTY; + if (IS_CUSTOM_ELEMENT(center_element)) + Store[x][y] = (Store[x][y] == EL_CURRENT_CE_VALUE ? ce_value : + Store[x][y] == EL_CURRENT_CE_SCORE ? ce_score : + Store[x][y] >= EL_PREV_CE_8 && + Store[x][y] <= EL_NEXT_CE_8 ? + RESOLVED_REFERENCE_ELEMENT(center_element, Store[x][y]) : + Store[x][y]); + if (x != ex || y != ey || mode == EX_TYPE_BORDER || center_element == EL_AMOEBA_TO_DIAMOND) Store2[x][y] = element; -- 2.34.1