From: Holger Schemel Date: Sat, 8 Apr 2023 11:24:34 +0000 (+0200) Subject: added supporting reference elements for custom element explosion content X-Git-Tag: 4.3.6.0~38 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=278196b1b8a46ae3e3b0e768202760ff496ac3c5;p=rocksndiamonds.git added supporting reference elements for custom element explosion content --- 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;