From cb6836f818d6e87cae9761d29ef75f8e0167e16b Mon Sep 17 00:00:00 2001 From: MysterD Date: Thu, 10 Sep 2020 21:55:03 -0700 Subject: [PATCH] Fixed infinite hold by King Bobomb softlock fixes #38 --- src/game/mario_actions_automatic.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c index a8eedaf5..2415c7e8 100644 --- a/src/game/mario_actions_automatic.c +++ b/src/game/mario_actions_automatic.c @@ -679,6 +679,14 @@ s32 act_grabbed(struct MarioState *m) { } if (m->usedObj != NULL) { m->heldByObj = m->usedObj; } set_mario_animation(m, MARIO_ANIM_BEING_GRABBED); + + // check if they should still be grabbed + if (m->playerIndex == 0) { + if (m->heldByObj == NULL || !(m->heldByObj->oInteractStatus | INT_STATUS_GRABBED_MARIO)) { + return set_mario_action(m, (m->forwardVel >= 0.0f) ? ACT_THROWN_FORWARD : ACT_THROWN_BACKWARD, FALSE); + } + } + return FALSE; }