From b594984e4548221db12c378fd465ac9968a8dd72 Mon Sep 17 00:00:00 2001 From: MysterD Date: Fri, 25 Sep 2020 01:03:16 -0700 Subject: [PATCH] Prevent bettercam from glitching out when opening one side of a door --- src/game/behaviors/door.inc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/game/behaviors/door.inc.c b/src/game/behaviors/door.inc.c index 9622346bc..081a61555 100644 --- a/src/game/behaviors/door.inc.c +++ b/src/game/behaviors/door.inc.c @@ -30,7 +30,14 @@ u8 door_allow_walk_through(void) { s32 cur = o->header.gfx.unk38.animFrame; s32 max = o->header.gfx.unk38.curAnim->unk08 - 2; - return (cur >= max / 4 && cur <= 7 * max / 8); + s32 min = max / 4; + + // make non-solid immediately for local actions so the camera doesn't glitch out + if (gMarioStates[0].marioObj != NULL && (gMarioStates[0].action == ACT_PULLING_DOOR || gMarioStates[0].action == ACT_PUSHING_DOOR)) { + min = 0; + } + + return (cur >= min && cur <= 7 * max / 8); } void set_door_camera_event(void) {