Skip to content

Commit

Permalink
move practice and replay rate bounds to [0.05,3.0]
Browse files Browse the repository at this point in the history
it was 0.3,5.0 before, which doesnt match anything else
  • Loading branch information
poco0317 committed Aug 25, 2023
1 parent 0c18bad commit f2177b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/Etterna/Screen/Gameplay/ScreenGameplayPractice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,11 @@ ScreenGameplayPractice::AddToRate(float amountAdded) -> float
const auto newRate = std::floor((rate + amountAdded) * 100 + 0.5) / 100;

// Rates outside of this range may crash
// Use 0.25 because of floating point errors...
if (newRate <= 0.25F || newRate > 3.F) {
return rate;
}
// (weird comparisons because floats)
if (0.05F - newRate > 0.001F)
return 0.05F;
if (newRate - 3.F > 0.001F)
return 3.F;

RageTimer tm;
const auto fSeconds = m_pSoundMusic->GetPositionSeconds(nullptr, &tm);
Expand Down
8 changes: 5 additions & 3 deletions src/Etterna/Screen/Gameplay/ScreenGameplayReplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,11 @@ ScreenGameplayReplay::SetRate(const float newRate) -> float
const auto rate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;

// Rates outside of this range may crash
if (newRate < 0.3F || newRate > 5.F) {
return rate;
}
// (weird comparisons because floats)
if (0.05F - newRate > 0.001F)
return 0.05F;
if (newRate - 3.F > 0.001F)
return 3.F;

const auto paused = GAMESTATE->GetPaused();

Expand Down

0 comments on commit f2177b7

Please sign in to comment.