Skip to content

Commit

Permalink
Correctly fake PlayerStageStats values in Replays
Browse files Browse the repository at this point in the history
this makes it so that conversions at the end of replays are always correct no matter what the outcome was, in case there were any bugs during execution (and otherwise cases)
  • Loading branch information
poco0317 committed Oct 4, 2019
1 parent a4c3ee1 commit e20bbd9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Etterna/Screen/Gameplay/ScreenGameplayReplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ ScreenGameplayReplay::Input(const InputEventPlus& input)
void
ScreenGameplayReplay::SaveStats()
{
// Reload the replay data to make sure it is clean for calculations
PlayerAI::SetScoreData();
// Also the notedata
SetupNoteDataFromRow(GAMESTATE->m_pCurSteps, -1);

// We need to replace the newly created replay data with the actual old
// data Because to keep consistently lazy practices, we can just hack
// things together instead of fixing the real issue -poco
Expand All @@ -224,6 +229,8 @@ ScreenGameplayReplay::StageFinished(bool bBackedOut)
return;
}

PlayerAI::SetPlayerStageStatsForReplay(m_vPlayerInfo.GetPlayerStageStats());

STATSMAN->m_CurStageStats.FinalizeScores(false);

STATSMAN->m_vPlayedStageStats.push_back(STATSMAN->m_CurStageStats);
Expand Down

0 comments on commit e20bbd9

Please sign in to comment.