From c2586f1a8a776e6c61aa9d9d02c8ec5c4401a8a2 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+AgentXLP@users.noreply.github.com> Date: Fri, 5 Jul 2024 19:46:09 -0400 Subject: [PATCH] Fix pressed_pause --- src/game/level_update.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/game/level_update.c b/src/game/level_update.c index d62eb585..dd9d3626 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -248,17 +248,18 @@ u16 level_control_timer(s32 timerOp) { } u32 pressed_pause(void) { - u32 dialogActive = get_dialog_id() >= 0; - u32 intangible = (gMarioState->action & ACT_FLAG_INTANGIBLE) != 0; - u32 firstPerson = gMarioState->action == ACT_FIRST_PERSON; + if (gServerSettings.pauseAnywhere) { + if (get_dialog_id() < 0 && !gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE) { + return gPlayer1Controller->buttonPressed & START_BUTTON; + } + } else { + u32 dialogActive = get_dialog_id() >= 0; + u32 intangible = (gMarioState->action & ACT_FLAG_INTANGIBLE) != 0; + u32 firstPerson = gMarioState->action == ACT_FIRST_PERSON; - if (!intangible && !dialogActive && !firstPerson && !gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE - && (gPlayer1Controller->buttonPressed & START_BUTTON)) { - return TRUE; - } - - if (gServerSettings.pauseAnywhere && get_dialog_id() < 0) { - return gPlayer1Controller->buttonPressed & START_BUTTON; + if (!intangible && !dialogActive && !firstPerson && !gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE) { + return (gPlayer1Controller->buttonPressed & START_BUTTON); + } } return FALSE; @@ -271,7 +272,7 @@ void set_play_mode(s16 playMode) { void warp_special(s32 arg) { if (arg != 0 && arg != SPECIAL_WARP_CAKE && arg != SPECIAL_WARP_GODDARD && arg != SPECIAL_WARP_GODDARD_GAMEOVER && arg != SPECIAL_WARP_TITLE && arg != SPECIAL_WARP_LEVEL_SELECT) { - LOG_ERROR("Invalid parameter value for warp_special: Expected SPECIAL_WARP_CAKE, SPECIAL_WARP_GODDARD, SPECIAL_WARP_GODDARD_GAMEOVER, SPECIAL_WARP_TITLE, or SPECIAL_WARP_LEVEL_SELECT"); + LOG_ERROR("Invalid parameter value for warp_special: Expected 0, SPECIAL_WARP_CAKE, SPECIAL_WARP_GODDARD, SPECIAL_WARP_GODDARD_GAMEOVER, SPECIAL_WARP_TITLE, or SPECIAL_WARP_LEVEL_SELECT"); return; }