Skip to content

Commit

Permalink
Fix v60 replays breaking when pausing
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Nov 15, 2018
1 parent 2efb3fa commit ae000d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/PlayerAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ struct TapScoreDistribution
static TapScoreDistribution g_Distributions[NUM_SKILL_LEVELS];

HighScore* PlayerAI::pScoreData = nullptr;
TimingData* PlayerAI::pReplayTiming = nullptr;
map<int, vector<TapReplayResult>> PlayerAI::m_ReplayTapMap;
map<int, vector<HoldReplayResult>> PlayerAI::m_ReplayHoldMap;
map<int, vector<TapReplayResult>> PlayerAI::m_ReplayExactTapMap;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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)
{
Expand Down
4 changes: 3 additions & 1 deletion src/PlayerAI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/ScreenGameplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ae000d7

Please sign in to comment.