Fix magic being zeroed out when using fast file select (#3389)
* Move to frame counter init to a place that fast file select also touches * Undo removing old fix * Reset on gameover
This commit is contained in:
@@ -207,6 +207,7 @@ static bool ResetHandler(std::shared_ptr<LUS::Console> Console, std::vector<std:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gPlayState->gameplayFrames = 0;
|
||||||
SET_NEXT_GAMESTATE(&gPlayState->state, TitleSetup_Init, GameState);
|
SET_NEXT_GAMESTATE(&gPlayState->state, TitleSetup_Init, GameState);
|
||||||
gPlayState->state.running = false;
|
gPlayState->state.running = false;
|
||||||
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnExitGame>(gSaveContext.fileNum);
|
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnExitGame>(gSaveContext.fileNum);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ u64 D_801614D0[0xA00];
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
PlayState* gPlayState;
|
PlayState* gPlayState;
|
||||||
|
s16 firstInit = 0;
|
||||||
|
|
||||||
s16 gEnPartnerId;
|
s16 gEnPartnerId;
|
||||||
|
|
||||||
@@ -490,6 +491,12 @@ void Play_Init(GameState* thisx) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Properly initialize the frame counter so it doesn't use garbage data
|
||||||
|
if (!firstInit) {
|
||||||
|
play->gameplayFrames = 0;
|
||||||
|
firstInit = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Invalid entrance, so immediately exit the game to opening title
|
// Invalid entrance, so immediately exit the game to opening title
|
||||||
if (gSaveContext.entranceIndex == -1) {
|
if (gSaveContext.entranceIndex == -1) {
|
||||||
gSaveContext.entranceIndex = 0;
|
gSaveContext.entranceIndex = 0;
|
||||||
|
|||||||
@@ -4290,6 +4290,8 @@ void KaleidoScope_Update(PlayState* play)
|
|||||||
if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) {
|
if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) {
|
||||||
Grotto_ForceGrottoReturn();
|
Grotto_ForceGrottoReturn();
|
||||||
}
|
}
|
||||||
|
// Reset frame counter to prevent autosave on respawn
|
||||||
|
play->gameplayFrames = 0;
|
||||||
gSaveContext.nextTransitionType = 2;
|
gSaveContext.nextTransitionType = 2;
|
||||||
gSaveContext.health = CVarGetInteger("gFullHealthSpawn", 0) ? gSaveContext.healthCapacity : 0x30;
|
gSaveContext.health = CVarGetInteger("gFullHealthSpawn", 0) ? gSaveContext.healthCapacity : 0x30;
|
||||||
Audio_QueueSeqCmd(0xF << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xA);
|
Audio_QueueSeqCmd(0xF << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xA);
|
||||||
|
|||||||
Reference in New Issue
Block a user