fixed calculating position of global animations triggered by CE change
[rocksndiamonds.git] / src / anim.c
index 710383f3c608c03e4e3832fea3b13e6ab6cc3bbf..9611fa67d2cbd4139aaba70cd6ebf0d8c8d4c4fd 100644 (file)
@@ -1736,8 +1736,10 @@ static int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part,
     int fy = getFieldbufferOffsetY_RND(ScreenMovDir, ScreenGfxPos);
     int sx = FX + SCREENX(part->tile_x) * TILEX_VAR;
     int sy = FY + SCREENY(part->tile_y) * TILEY_VAR;
-    int x = sx - fx;
-    int y = sy - fy;
+    int cx = SX - REAL_SX;
+    int cy = SY - REAL_SY;
+    int x = sx - fx + cx;
+    int y = sy - fy + cy;
 
     part->tile_xoffset += part->step_xoffset;
     part->tile_yoffset += part->step_yoffset;
@@ -2164,6 +2166,11 @@ void RestartGlobalAnimsByStatus(int status)
   global.anim_status = anim_status_last;
 }
 
+void SetAnimStatusBeforeFading(int status)
+{
+  anim_status_last_before_fading = status;
+}
+
 boolean HandleGlobalAnimClicks(int mx, int my, int button, boolean force_click)
 {
   static boolean click_consumed = FALSE;