X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=299fd72bdd934957fc06ca6e9343f1ad315c60aa;hb=a761d121263d681381a61087f110a9320626a8d0;hp=c3b2ef7efa08938c50f2d43ddb4091eb2815a70c;hpb=c0f95d8de44a0a46ffe295beba37937c6f5df0c2;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index c3b2ef7e..299fd72b 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, page); + if (change->explode) { Bang(x, y);