From 635a89c35cc17053a40ec6cec0efb804c5c4185c Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 19 May 2012 14:43:02 +0200 Subject: [PATCH] Issue #256: RNG fix --- apps/openmw/mwmechanics/magiceffects.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/magiceffects.cpp b/apps/openmw/mwmechanics/magiceffects.cpp index f71e070d21..a77e199661 100644 --- a/apps/openmw/mwmechanics/magiceffects.cpp +++ b/apps/openmw/mwmechanics/magiceffects.cpp @@ -79,7 +79,8 @@ namespace MWMechanics param.mMagnitude = iter->magnMin; else param.mMagnitude = static_cast ( - (iter->magnMax-iter->magnMin+1)*(std::rand() / RAND_MAX) + iter->magnMin); + (iter->magnMax-iter->magnMin+1)* + (static_cast (std::rand()) / RAND_MAX) + iter->magnMin); add (*iter, param); }