From ee2f3db9a87abf24341f4247b7748d5aa935ef6e Mon Sep 17 00:00:00 2001 From: rexelion Date: Sat, 4 Nov 2017 01:31:15 +0000 Subject: [PATCH] fixed randomness --- apps/openmw/mwmechanics/character.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index dffc095e9..deb9daa93 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -255,7 +255,7 @@ void CharacterController::refreshHitRecoilAnims() && mAnimation->hasAnimation("knockout")) { 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")) { mHitState = CharState_SwimKnockOut;