fix quest assignment (#3343)

This commit is contained in:
Adam Bird
2023-11-04 17:52:09 -04:00
committed by GitHub
parent 25f05e68b3
commit 44ee6da0aa
7 changed files with 17 additions and 20 deletions

View File

@@ -1202,7 +1202,7 @@ void Play_Update(PlayState* play) {
play->gameplayFrames++;
// Gameplay stat tracking
if (!gSaveContext.sohStats.gameComplete &&
(!IS_BOSS_RUSH || (IS_BOSS_RUSH && !gSaveContext.isBossRushPaused))) {
(!IS_BOSS_RUSH || !gSaveContext.isBossRushPaused)) {
gSaveContext.sohStats.playTimer++;
gSaveContext.sohStats.sceneTimer++;
gSaveContext.sohStats.roomTimer++;

View File

@@ -10,6 +10,8 @@
void Save_LoadFile(void);
void BossRush_InitSave(void);
/**
* Initialize new save.
* This save has an empty inventory with 3 hearts and single magic.
@@ -33,6 +35,7 @@ void Sram_InitDebugSave(void) {
void Sram_InitBossRushSave(void) {
Save_InitFile(false);
BossRush_InitSave();
}
/**
@@ -221,11 +224,15 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
gSaveContext.n64ddFlag = fileChooseCtx->n64ddFlag;
if (fileChooseCtx->questType[fileChooseCtx->buttonIndex] == QUEST_RANDOMIZER &&
u8 currentQuest = fileChooseCtx->questType[fileChooseCtx->buttonIndex];
if (currentQuest == QUEST_RANDOMIZER &&
strnlen(CVarGetString("gSpoilerLog", ""), 1) != 0) {
gSaveContext.questId = QUEST_RANDOMIZER;
Randomizer_InitSaveFile();
} else if (currentQuest == QUEST_MASTER) {
gSaveContext.questId = QUEST_MASTER;
}
Save_SaveFile();

View File

@@ -1293,8 +1293,6 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) {
if (CHECK_BTN_ALL(input->press.button, BTN_A)) {
gSaveContext.questId = this->questType[this->buttonIndex];
gSaveContext.isBossRushPaused = false;
if (this->questType[this->buttonIndex] == QUEST_BOSSRUSH) {
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
this->prevConfigMode = this->configMode;
@@ -2819,10 +2817,6 @@ void FileChoose_ConfirmFile(GameState* thisx) {
if (this->confirmButtonIndex == FS_BTN_CONFIRM_YES) {
func_800AA000(300.0f, 180, 20, 100);
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
// Reset Boss Rush because it's only ever saved in memory.
if (IS_BOSS_RUSH) {
gSaveContext.questId = QUEST_NORMAL;
}
this->selectMode = SM_FADE_OUT;
func_800F6964(0xF);
} else {

View File

@@ -4307,9 +4307,6 @@ void KaleidoScope_Update(PlayState* play)
osSyncPrintf(VT_RST);
} else {
play->state.running = 0;
if (IS_BOSS_RUSH) {
gSaveContext.questId = QUEST_NORMAL;
}
SET_NEXT_GAMESTATE(&play->state, Opening_Init, OpeningContext);
GameInteractor_ExecuteOnExitGame(gSaveContext.fileNum);
}