From: Holger Schemel Date: Tue, 12 Dec 2023 11:03:28 +0000 (+0100) Subject: reverted order of processing game modes for global animations clicks X-Git-Tag: 4.3.8.1~9 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=5dc79304dfe047b935e5aeefde3b73ad4d4a83f8;p=rocksndiamonds.git 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. --- 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;