From 258e6e2b82cfa28a9e595f70486fb780b624fce9 Mon Sep 17 00:00:00 2001 From: MysterD Date: Sun, 14 May 2023 12:28:31 -0700 Subject: [PATCH] Fix crash in execute_mario_action() --- src/game/mario.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/game/mario.c b/src/game/mario.c index a3f090c3..d42465f9 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -2010,6 +2010,9 @@ static u8 prevent_hang(u32 hangPreventionActions[], u8* hangPreventionIndex) { */ s32 execute_mario_action(UNUSED struct Object *o) { s32 inLoop = TRUE; + if (!gMarioState) { return 0; } + if (!gMarioState->marioObj) { return 0; } + if (gMarioState->playerIndex >= MAX_PLAYERS) { return 0; } if (gMarioState->knockbackTimer > 0) { gMarioState->knockbackTimer--;