Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/game/interaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,10 @@ u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct O
u32 starIndex;
u32 starGrabAction = ACT_STAR_DANCE_EXIT;
u32 noExit = (o->oInteractionSubtype & INT_SUBTYPE_NO_EXIT) != 0;
u8 stayInLevelCommon = !(m->controller->buttonDown & L_TRIG || gCurrLevelNum == LEVEL_BOWSER_1 || gCurrLevelNum == LEVEL_BOWSER_2 || gCurrLevelNum == LEVEL_BOWSER_3);
if (stayInLevelCommon == TRUE) {
noExit = TRUE;
}
u32 grandStar = (o->oInteractionSubtype & INT_SUBTYPE_GRAND_STAR) != 0;

if (m->health >= 0x100) {
Expand Down Expand Up @@ -820,7 +824,11 @@ u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct O
return set_mario_action(m, ACT_JUMBO_STAR_CUTSCENE, 0);
}

return set_mario_action(m, starGrabAction, noExit + 2 * grandStar);
if (stayInLevelCommon == FALSE) {
return set_mario_action(m, starGrabAction, noExit + 2 * grandStar);
}
//If nonstop StayInLevel is enabled, autosave
save_file_do_save(gCurrSaveFileNum - 1);
}

return FALSE;
Expand Down
5 changes: 5 additions & 0 deletions src/game/mario_actions_cutscene.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,11 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) {
set_mario_action(m, ACT_READING_AUTOMATIC_DIALOG, dialogID);
} else {
set_mario_action(m, isInWater ? ACT_WATER_IDLE : ACT_IDLE, 0);
set_fov_function(CAM_FOV_DEFAULT);
// fix camera bug when getting a star underwater with StayInLevel cheat enabled
if (isInWater) {
cutscene_exit_painting_end(m->area->camera);
}
}
}
}
Expand Down