fixed handling global animation click events (again)
[rocksndiamonds.git] / src / anim.c
index 0aa1c0f4ff12a0970415d9c2b5f67f87429f8b04..14dccc69c46d25a34764b0cbdbf7e18bd2354ad3 100644 (file)
@@ -1760,9 +1760,11 @@ static void InitGlobalAnim_Clickable(void)
 static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event)
 {
   boolean click_consumed = FALSE;
+  boolean anything_clicked = FALSE;
   boolean any_part_clicked = FALSE;
   boolean any_event_action = FALSE;
   int mode_nr;
+  int i;
 
   // check game modes in reverse draw order (to stop when clicked)
   for (mode_nr = NUM_GAME_MODES - 1; mode_nr >= 0; mode_nr--)
@@ -1803,7 +1805,7 @@ static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event)
                 part->old_anim_nr + 1, part->old_nr + 1);
 #endif
 
-         part->clicked = TRUE;
+         anything_clicked = part->clicked = TRUE;
          click_consumed |= clickConsumed(part);
        }
 
@@ -1816,7 +1818,7 @@ static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event)
                 part->old_anim_nr + 1, part->old_nr + 1);
 #endif
 
-         part->clicked = TRUE;
+         anything_clicked = part->clicked = TRUE;
          click_consumed |= clickConsumed(part);
        }
 
@@ -1846,7 +1848,7 @@ static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event)
                   part->old_anim_nr + 1, part->old_nr + 1);
 #endif
 
-           part->clicked = TRUE;
+           anything_clicked = part->clicked = TRUE;
            click_consumed |= clickConsumed(part);
          }
 
@@ -1858,13 +1860,17 @@ static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event)
     }
   }
 
-  if (click_consumed)
+  if (anything_clicked)
   {
     handle_click = TRUE;
 
-    HandleGlobalAnim(ANIM_CONTINUE, game_status);
+    for (i = 0; i < NUM_GAME_MODES; i++)
+      HandleGlobalAnim(ANIM_CONTINUE, i);
 
     handle_click = FALSE;
+
+    // prevent ignoring release event if processed within same game frame
+    StopProcessingEvents();
   }
 
   return (click_consumed || any_event_action);