fix respawn stageinfo when autosaving

This commit is contained in:
MelonSpeedruns
2026-05-02 10:42:20 -04:00
parent c1ba10fc8b
commit e3ad41792a
2 changed files with 8 additions and 5 deletions
+4 -4
View File
@@ -702,7 +702,7 @@ static u32 l_sceneChangeStartTick;
#endif
#if TARGET_PC
static BOOL shouldAutoSave;
static BOOL autoSaved;
#endif
static int dScnPly_Execute(dScnPly_c* i_this) {
@@ -749,10 +749,10 @@ static int dScnPly_Execute(dScnPly_c* i_this) {
#if TARGET_PC
if (!dComIfGp_event_runCheck() && !fopOvlpM_IsPeek() && !dComIfG_resetToOpening(i_this) &&
!dComIfGp_isEnableNextStage() && shouldAutoSave == FALSE)
!dComIfGp_isEnableNextStage() && autoSaved == FALSE)
{
triggerAutoSave();
shouldAutoSave = TRUE;
autoSaved = TRUE;
}
#endif
@@ -1609,7 +1609,7 @@ static int dScnPly_Create(scene_class* i_this) {
int phase_state = dComLbG_PhaseHandler(&a_this->field_0x1c4, l_method, a_this);
#if TARGET_PC
shouldAutoSave = FALSE;
autoSaved = FALSE;
#endif
return phase_state;
+4 -1
View File
@@ -14,7 +14,7 @@ void noAutoSave() {}
void triggerAutoSave() {
if (dusk::getSettings().game.autoSave && mAutoSaveProc == 0 &&
strcmp(dComIfGp_getStartStageName(), "F_SP102") != 0 && dComIfGp_getStartStageLayer() != 0)
strcmp(dComIfGp_getStartStageName(), "F_SP102") != 0)
{
mAutoSaveProc = 1;
}
@@ -25,6 +25,9 @@ void updateAutoSave() {
}
void writeAutoSave() {
int stageNo = dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo());
dComIfGs_putSave(stageNo);
dComIfGs_setMemoryToCard(mSaveBuffer, dComIfGs_getDataNum());
mDoMemCdRWm_SetCheckSumGameData(mSaveBuffer, dComIfGs_getDataNum());