X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=0d1830340a376487b5c2b7d6cd972b537a7060d7;hb=064d7909aadd84f633fefcccee3c6f6eb44d47ff;hp=c3b2ef7efa08938c50f2d43ddb4091eb2815a70c;hpb=f110301d5f36f0a9bf0a7f45208c4cd6c85acb01;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index c3b2ef7e..0d183034 100644 --- a/src/game.c +++ b/src/game.c @@ -3195,6 +3195,17 @@ static void InitGameEngine(void) SET_PROPERTY(ch_delay->element, EP_CAN_CHANGE_OR_HAS_ACTION, TRUE); } + // ---------- initialize if element can trigger global animations ----------- + + for (i = 0; i < MAX_NUM_ELEMENTS; i++) + { + struct ElementInfo *ei = &element_info[i]; + + ei->has_anim_event = FALSE; + } + + InitGlobalAnimEventsForCustomElements(); + // ---------- initialize internal run-time variables ------------------------ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) @@ -10704,6 +10715,9 @@ static boolean ChangeElement(int x, int y, int element, int page) ChangeCount[x][y]++; // count number of changes in the same frame + if (ei->has_anim_event) + HandleGlobalAnimEventByElementChange(element); + if (change->explode) { Bang(x, y);