From ae000d780f5979f7ea2abbf8b4e9d16cebe5f30e Mon Sep 17 00:00:00 2001 From: poco0317 Date: Thu, 15 Nov 2018 13:32:26 -0600 Subject: [PATCH] Fix v60 replays breaking when pausing --- src/PlayerAI.cpp | 4 +++- src/PlayerAI.h | 4 +++- src/ScreenGameplay.cpp | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/PlayerAI.cpp b/src/PlayerAI.cpp index 8261339bba..d3f0e9da76 100644 --- a/src/PlayerAI.cpp +++ b/src/PlayerAI.cpp @@ -50,6 +50,7 @@ struct TapScoreDistribution static TapScoreDistribution g_Distributions[NUM_SKILL_LEVELS]; HighScore* PlayerAI::pScoreData = nullptr; +TimingData* PlayerAI::pReplayTiming = nullptr; map> PlayerAI::m_ReplayTapMap; map> PlayerAI::m_ReplayHoldMap; map> PlayerAI::m_ReplayExactTapMap; @@ -158,7 +159,6 @@ PlayerAI::SetScoreData(HighScore* pHighScore) pScoreData = pHighScore; m_ReplayTapMap.clear(); m_ReplayHoldMap.clear(); - m_ReplayExactTapMap.clear(); auto replayNoteRowVector = pHighScore->GetCopyOfNoteRowVector(); auto replayOffsetVector = pHighScore->GetCopyOfOffsetVector(); @@ -220,6 +220,8 @@ PlayerAI::SetUpExactTapMap(TimingData* timing) if (pScoreData->GetReplayType() != 2) return; + pReplayTiming = timing; + // For every row in the replay data... for (auto& row : m_ReplayTapMap) { diff --git a/src/PlayerAI.h b/src/PlayerAI.h index 58e8a814a2..27d3ab384e 100644 --- a/src/PlayerAI.h +++ b/src/PlayerAI.h @@ -14,9 +14,11 @@ class PlayerAI { public: // Pointer to real high score data for a replay - static HighScore* pScoreData; + // Pointer to real timing data for a replay + static TimingData* pReplayTiming; + // Pulled from pScoreData on initialization // A map with indices for each row of the chart, pointing to nothing or a diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index ee61d5a693..4782c45c8d 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -2849,6 +2849,7 @@ ScreenGameplay::ToggleReplayPause() ReloadCurrentSong(); STATSMAN->m_CurStageStats.m_player[PLAYER_1].InternalInit(); PlayerAI::SetScoreData(PlayerAI::pScoreData); + PlayerAI::SetUpExactTapMap(PlayerAI::pReplayTiming); // Reset the wife/judge counter related visible stuff FOREACH_ENUM(TapNoteScore, tns)