Skip to content

Commit

Permalink
Fix Practice Rate changing causing Player Options to reset rate to 0.5x
Browse files Browse the repository at this point in the history
floating point errors and stuff cause tiny errors that, when the game tries to match those to existing player option strings, reveal errors
... so basically 1.05 is more like 1.049999995 and thats not good
  • Loading branch information
poco0317 committed Nov 24, 2019
1 parent a4b28f6 commit 128690e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Etterna/Screen/Gameplay/ScreenGameplayPractice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ float
ScreenGameplayPractice::AddToRate(float amountAdded)
{
float rate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
float newRate = rate + amountAdded;
double newRate = std::floor((rate + amountAdded) * 100 + 0.5) / 100;

// Rates outside of this range may crash
// Use 0.25 because of floating point errors...
Expand Down

0 comments on commit 128690e

Please sign in to comment.