Skip to content

Commit

Permalink
prevent crashes due to people setting rate mod below 0.7 or above 2.0…
Browse files Browse the repository at this point in the history
… and calling getmsd - mina
  • Loading branch information
MinaciousGrace committed Jan 21, 2017
1 parent 34dbd39 commit f8e746e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Steps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ void Steps::Decompress(bool isGameplay)

float Steps::GetMSD(float x, int i) const {
int idx = static_cast<int>(x * 10) - 7;
CLAMP(idx, 0, 13); // prevent crashes due to people setting rate mod below 0.7 or above 2.0 somehow - mina
float prop = fmod(x * 10.f, 1.f);
if ( prop == 0)
return stuffnthings[idx][i];
Expand Down

0 comments on commit f8e746e

Please sign in to comment.