Skip to content

Commit

Permalink
fix settings not persisting correctly in replay gameplay
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Dec 19, 2022
1 parent 39e9093 commit 0785900
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Etterna/Screen/Gameplay/ScreenGameplayReplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,8 @@ ScreenGameplayReplay::~ScreenGameplayReplay()
GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate = settings.oldRate;
GAMESTATE->m_SongOptions.GetSong().m_fMusicRate = settings.oldRate;
GAMESTATE->m_SongOptions.GetStage().m_fMusicRate = settings.oldRate;
} else {
REPLAYS->InitReplayPlaybackForScore(REPLAYS->GetActiveReplayScore(),
Player::GetTimingWindowScale());

REPLAYS->ResetActiveReplaySettings();
}
}

Expand Down
1 change: 1 addition & 0 deletions src/Etterna/Screen/Others/ScreenSelectMusic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1785,6 +1785,7 @@ class LunaScreenSelectMusic : public Luna<ScreenSelectMusic>
auto usesMirror = potmp.m_bTurns[PlayerOptions::TURN_MIRROR];
auto replayRng = hs->GetStageSeed();
auto hsMods = hs->GetModifiers();
REPLAYS->ResetActiveReplaySettings();
REPLAYS->StoreActiveReplaySettings(scoreRate,
hsMods,
usesMirror,
Expand Down
8 changes: 6 additions & 2 deletions src/Etterna/Singletons/ReplayManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ ReplayManager::InitReplayPlaybackForScore(HighScore* hs,

activeReplayScore = hs;
activeReplay = GetReplay(hs);
activeReplaySettings.reset();

activeReplay->GenerateJudgeInfoAndReplaySnapshots(startRow, timingScale);

Expand All @@ -135,7 +134,6 @@ ReplayManager::UnsetActiveReplay()
}
activeReplayScore = nullptr;
activeReplay = GetReplay(nullptr);
activeReplaySettings.reset();
}

Replay*
Expand Down Expand Up @@ -185,6 +183,12 @@ ReplayManager::GetActiveReplaySettings()
return activeReplaySettings;
}

void
ReplayManager::ResetActiveReplaySettings()
{
activeReplaySettings.reset();
}

auto
ReplayManager::CalculateRadarValuesForReplay(Replay& replay, RadarValues& rv, RadarValues& possibleRV)
-> bool
Expand Down
1 change: 1 addition & 0 deletions src/Etterna/Singletons/ReplayManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class ReplayManager
int oldRngSeed);

TemporaryReplaySettings GetActiveReplaySettings();
void ResetActiveReplaySettings();

static TapNoteScore GetTapNoteScoreForReplay(float fNoteOffset,
float timingScale = 1.F);
Expand Down

0 comments on commit 0785900

Please sign in to comment.