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).
This commit is contained in:
Emily♥ 2025-11-13 16:24:14 -05:00 committed by GitHub
parent 520404a4c0
commit 88c69c3f22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -456,6 +456,7 @@ void mario_retrieve_cap(struct MarioState* m) {
if (!m) { return; } if (!m) { return; }
mario_drop_held_object(m); mario_drop_held_object(m);
save_file_clear_flags(SAVE_FLAG_CAP_ON_KLEPTO | SAVE_FLAG_CAP_ON_UKIKI); 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_CAP_ON_HEAD;
m->flags |= MARIO_NORMAL_CAP | MARIO_CAP_IN_HAND; 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; capTime = gLevelValues.wingCapDuration;
capMusic = SEQUENCE_ARGS(4, gLevelValues.wingCapSequence); capMusic = SEQUENCE_ARGS(4, gLevelValues.wingCapSequence);
break; break;
case MARIO_NORMAL_CAP:
m->cap = 0;
break;
} }
if (capTime > m->capTimer) { if (capTime > m->capTimer) {

View file

@ -370,7 +370,6 @@ void cutscene_put_cap_on(struct MarioState *m) {
m->flags &= ~MARIO_CAP_IN_HAND; m->flags &= ~MARIO_CAP_IN_HAND;
m->flags |= MARIO_CAP_ON_HEAD; m->flags |= MARIO_CAP_ON_HEAD;
play_sound(SOUND_ACTION_UNKNOWN43E, m->marioObj->header.gfx.cameraToObject); play_sound(SOUND_ACTION_UNKNOWN43E, m->marioObj->header.gfx.cameraToObject);
m->cap = 0;
} }
/** /**