From a612f739537ac8d1b0dc9946910d1e548622ca00 Mon Sep 17 00:00:00 2001 From: MegaMech Date: Sun, 27 Mar 2022 17:19:16 -0700 Subject: [PATCH] Update z_player.c --- .../overlays/actors/ovl_player_actor/z_player.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index d02788a8e..f669611b7 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -487,6 +487,9 @@ static s16 D_80853610 = 0; static s32 D_80853614 = 0; static s32 D_80853618 = 0; +static s32 sNoClip = false; +static s32 sLastNoClip = false; + static u16 D_8085361C[] = { NA_SE_VO_LI_SWEAT, NA_SE_VO_LI_SNEEZE, @@ -13129,10 +13132,18 @@ void func_8084FBF4(Player* this, GlobalContext* globalCtx) { s32 func_8084FCAC(Player* this, GlobalContext* globalCtx) { sControlInput = &globalCtx->state.input[0]; - if (CVar_GetS32("gDebugEnabled", 0) && ((CHECK_BTN_ALL(sControlInput->cur.button, BTN_A | BTN_L | BTN_R) && + + s32 clip = CVar_GetS32("SV_NOCLIP", 1); + + if (clip != sLastNoClip) { + sLastNoClip = clip; + sNoClip = true; + } + + if ((CVar_GetS32("gDebugEnabled", 0) && (sNoClip))) || ((CHECK_BTN_ALL(sControlInput->cur.button, BTN_A | BTN_L | BTN_R) && CHECK_BTN_ALL(sControlInput->press.button, BTN_B)) || (CHECK_BTN_ALL(sControlInput->cur.button, BTN_L) && CHECK_BTN_ALL(sControlInput->press.button, BTN_DRIGHT)))) { - + sNoClip = false; D_808535D0 ^= 1; if (D_808535D0) { @@ -14806,4 +14817,4 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) { this->naviActor->flags |= ACTOR_FLAG_8; func_80835EA4(globalCtx, 0xB); } -} \ No newline at end of file +}