added setting global animation position from CE triggering that animation
[rocksndiamonds.git] / src / game.c
index 299fd72bdd934957fc06ca6e9343f1ad315c60aa..8cabb12de8c3ec028aaf681cc3196b4b00142225 100644 (file)
@@ -10716,7 +10716,14 @@ 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);
+  {
+    int fx = getFieldbufferOffsetX_RND(ScreenMovDir, ScreenGfxPos);
+    int fy = getFieldbufferOffsetY_RND(ScreenMovDir, ScreenGfxPos);
+    int sx = FX + SCREENX(x) * TILEX_VAR;
+    int sy = FY + SCREENY(y) * TILEY_VAR;
+
+    HandleGlobalAnimEventByElementChange(element, page, sx - fx, sy - fy);
+  }
 
   if (change->explode)
   {