From 5dc79304dfe047b935e5aeefde3b73ad4d4a83f8 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 12 Dec 2023 12:03:28 +0100 Subject: [PATCH] reverted order of processing game modes for global animations clicks The assumptions that led to the change that is reverted here were simply wrong: When drawing global animations in a certain order, checking for mouse clicks must be done in reverse order, to ensure that the click is processed for the topmost global animation. This includes processing game modes in reverse order (which are handled in normal order when drawing global animations). Processing clicks for a global animation based custom mouse pointer should be handled separately anyway, to process it independently from the game mode it was defined for. This reverts commit e3411dc9. --- src/anim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/anim.c b/src/anim.c index 08abd668..dcd66e33 100644 --- a/src/anim.c +++ b/src/anim.c @@ -2120,7 +2120,8 @@ static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event) int mode_nr; int i; - for (mode_nr = 0; mode_nr < NUM_GAME_MODES; mode_nr++) + // check game modes in reverse draw order (to stop when clicked) + for (mode_nr = NUM_GAME_MODES - 1; mode_nr >= 0; mode_nr--) { struct GlobalAnimControlInfo *ctrl = &global_anim_ctrl[mode_nr]; int anim_nr; -- 2.34.1