From: Holger Schemel Date: Sat, 2 Dec 2023 10:32:22 +0000 (+0100) Subject: removed duplicate variable to check if request dialog is active X-Git-Tag: 4.3.8.0~28 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=27d25dccefb519f3e710c21b025bfdfe9a991ef8;p=rocksndiamonds.git removed duplicate variable to check if request dialog is active --- diff --git a/src/anim.c b/src/anim.c index 6d761f43..3c58fa91 100644 --- a/src/anim.c +++ b/src/anim.c @@ -398,8 +398,8 @@ static boolean isPausedOnPlayfieldOrDoor(struct GlobalAnimPartControlInfo *part) if (!part->class_playfield_or_door) return FALSE; - // only pause animations when engine is paused or request dialog is open(ing) - if (!tape.pausing && !game.request_active_or_moving) + // only pause animations when engine is paused or request dialog is active + if (!tape.pausing && !game.request_active) return FALSE; return TRUE; diff --git a/src/game.c b/src/game.c index dc1e2442..a2dcd13d 100644 --- a/src/game.c +++ b/src/game.c @@ -4549,9 +4549,7 @@ void InitGame(void) } game.restart_level = FALSE; - game.request_active = FALSE; - game.request_active_or_moving = FALSE; if (level.game_engine_type == GAME_ENGINE_TYPE_MM) InitGameActions_MM(); @@ -15804,7 +15802,7 @@ boolean CheckRestartGame(void) return FALSE; } - // do not handle game over if request dialog is already active + // do not ask to play again if request dialog is already active if (game.request_active) return FALSE; diff --git a/src/game.h b/src/game.h index dee1bdb1..8fdfbdc8 100644 --- a/src/game.h +++ b/src/game.h @@ -246,7 +246,6 @@ struct GameInfo // values for special request dialog control boolean request_active; - boolean request_active_or_moving; // values for special game control int centered_player_nr; diff --git a/src/init.c b/src/init.c index 33c47f98..f9e46b4f 100644 --- a/src/init.c +++ b/src/init.c @@ -5493,9 +5493,7 @@ static void InitSetup(void) static void InitGameInfo(void) { game.restart_level = FALSE; - game.request_active = FALSE; - game.request_active_or_moving = FALSE; game.use_masked_elements_initial = FALSE; } diff --git a/src/tools.c b/src/tools.c index 78adf94b..f7fc34a2 100644 --- a/src/tools.c +++ b/src/tools.c @@ -3063,7 +3063,7 @@ static void PrepareEnvelopeRequestToScreen(Bitmap *bitmap, int sx, int sy, void DrawEnvelopeRequestToScreen(int drawing_target) { if (global.use_envelope_request && - game.request_active_or_moving && + game.request_active && drawing_target == DRAW_TO_SCREEN) { if (graphic_info[IMG_BACKGROUND_REQUEST].draw_masked) @@ -4508,8 +4508,6 @@ static int RequestHandleEvents(unsigned int req_state, int draw_buffer_game) if (game_just_ended) game.panel.active = FALSE; - game.request_active = TRUE; - setRequestPosition(&sx, &sy, FALSE); button_status = MB_RELEASED; @@ -4810,8 +4808,6 @@ static int RequestHandleEvents(unsigned int req_state, int draw_buffer_game) SetDrawtoField(draw_buffer_last); - game.request_active = FALSE; - return result; } @@ -5089,7 +5085,7 @@ boolean Request(char *text, unsigned int req_state) boolean overlay_enabled = GetOverlayEnabled(); boolean result; - game.request_active_or_moving = TRUE; + game.request_active = TRUE; SetOverlayEnabled(FALSE); @@ -5100,7 +5096,7 @@ boolean Request(char *text, unsigned int req_state) SetOverlayEnabled(overlay_enabled); - game.request_active_or_moving = FALSE; + game.request_active = FALSE; return result; }