fixed randomness

pull/331/head
rexelion 7 years ago
parent de83ad0116
commit ee2f3db9a8

@ -255,7 +255,7 @@ void CharacterController::refreshHitRecoilAnims()
&& mAnimation->hasAnimation("knockout")) && mAnimation->hasAnimation("knockout"))
{ {
mTimeToWake = time(NULL); mTimeToWake = time(NULL);
mTimeToWake += rand() % 2 + 1; // Wake up after 1 to 3 seconds mTimeToWake += (int)( (float)rand() / (float)RAND_MAX * 2) + 1; // Wake up after 1 to 3 seconds
if (isSwimming && mAnimation->hasAnimation("swimknockout")) if (isSwimming && mAnimation->hasAnimation("swimknockout"))
{ {
mHitState = CharState_SwimKnockOut; mHitState = CharState_SwimKnockOut;

Loading…
Cancel
Save