From 88c69c3f22a8c5f269ae03261ab13d985a57be6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emily=E2=99=A5?= <77174187+EmilyEmmi@users.noreply.github.com> Date: Thu, 13 Nov 2025 16:24:14 -0500 Subject: [PATCH] Fix issues with normal cap (#1003) Fixes the following issues: - Mario no longer regains his normal cap when doing the picking up cap action (this allowed you to reobtain it by picking up a Wing Cap, for example) - Mario will now regain his cap from the ground, even without going into the cutscene. Previously, Mario had to enter the cutscene action to get the cap, so it wouldn't activate if Mario jumped into the cap (Klepto and Mr. Blizzard set the flags directly). --- src/game/interaction.c | 5 +++++ src/game/mario_actions_cutscene.c | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/game/interaction.c b/src/game/interaction.c index 472fa4d80..d81651099 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -456,6 +456,7 @@ void mario_retrieve_cap(struct MarioState* m) { if (!m) { return; } mario_drop_held_object(m); save_file_clear_flags(SAVE_FLAG_CAP_ON_KLEPTO | SAVE_FLAG_CAP_ON_UKIKI); + m->cap &= ~(SAVE_FLAG_CAP_ON_KLEPTO | SAVE_FLAG_CAP_ON_UKIKI); m->flags &= ~MARIO_CAP_ON_HEAD; m->flags |= MARIO_NORMAL_CAP | MARIO_CAP_IN_HAND; } @@ -2156,6 +2157,10 @@ u32 interact_cap(struct MarioState *m, UNUSED u32 interactType, struct Object *o capTime = gLevelValues.wingCapDuration; capMusic = SEQUENCE_ARGS(4, gLevelValues.wingCapSequence); break; + + case MARIO_NORMAL_CAP: + m->cap = 0; + break; } if (capTime > m->capTimer) { diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index a06f5705f..51026b681 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -370,7 +370,6 @@ void cutscene_put_cap_on(struct MarioState *m) { m->flags &= ~MARIO_CAP_IN_HAND; m->flags |= MARIO_CAP_ON_HEAD; play_sound(SOUND_ACTION_UNKNOWN43E, m->marioObj->header.gfx.cameraToObject); - m->cap = 0; } /**