From fffebd106513bdc1db4c38482e9b33f2cc293b69 Mon Sep 17 00:00:00 2001 From: Reonu Date: Sat, 17 Jun 2023 01:57:33 +0100 Subject: [PATCH] add death on exit course define (#564) if the define is enabled, exiting course is the same as dying (warps to failure warp node) --- include/config/config_menu.h | 8 +++++++- src/game/level_update.c | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/config/config_menu.h b/include/config/config_menu.h index c3909221..f5d434a6 100644 --- a/include/config/config_menu.h +++ b/include/config/config_menu.h @@ -17,7 +17,13 @@ #define EXIT_COURSE_WHILE_MOVING /** - * Decides which level, area and warp ID the "Exit Course" option takes you to (has no effect if you disable Exit Course). + * Decides whether to treat exiting course as if the player had died. + * If enabled, the player will get warped to the failure warp node when selecting EXIT COURSE. (Has no effect if you disable Exit Course) + */ +// #define DEATH_ON_EXIT_COURSE + +/** + * Decides which level, area and warp ID the "Exit Course" option takes you to (has no effect if you disable Exit Course or enable DEATH_ON_EXIT_COURSE). * Ensure that the warp exists, or else the game will crash. */ #define EXIT_COURSE_LEVEL LEVEL_CASTLE diff --git a/src/game/level_update.c b/src/game/level_update.c index e2f7b0a7..77f1de81 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -1069,9 +1069,16 @@ s32 play_mode_paused(void) { if (gDebugLevelSelect) { fade_into_special_warp(WARP_SPECIAL_LEVEL_SELECT, 1); } else { +#ifdef DEATH_ON_EXIT_COURSE + raise_background_noise(1); + gCameraMovementFlags &= ~CAM_MOVE_PAUSE_SCREEN; + set_play_mode(PLAY_MODE_NORMAL); + level_trigger_warp(gMarioState, WARP_OP_DEATH); +#else initiate_warp(EXIT_COURSE_LEVEL, EXIT_COURSE_AREA, EXIT_COURSE_NODE, WARP_FLAG_EXIT_COURSE); fade_into_special_warp(WARP_SPECIAL_NONE, 0); gSavedCourseNum = COURSE_NONE; +#endif } gCameraMovementFlags &= ~CAM_MOVE_PAUSE_SCREEN;