aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2009-07-09 15:32:25 +0000
committerJohannes Schickel2009-07-09 15:32:25 +0000
commita17333ed1b817303ca08b0f73fbdf4bf9bdef1fd (patch)
tree1b31f6f27ae0480fedc6d238f08209afac3b327c /engines
parenta7c96e15268d15a0a13f0cf5321a7c51587aa3f9 (diff)
downloadscummvm-rg350-a17333ed1b817303ca08b0f73fbdf4bf9bdef1fd.tar.gz
scummvm-rg350-a17333ed1b817303ca08b0f73fbdf4bf9bdef1fd.tar.bz2
scummvm-rg350-a17333ed1b817303ca08b0f73fbdf4bf9bdef1fd.zip
Cleanup rollDice (the results of the old and the new function are almost identical).
svn-id: r42293
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/lol.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 4be0e413e1..d2c8be9556 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -1877,15 +1877,8 @@ int LoLEngine::rollDice(int times, int pips) {
return 0;
int res = 0;
- int d = 0;
-
- do {
- int val = (((int)_rnd.getRandomNumber(0x7fff) * pips) / 0x8000) + 1;
- if (val > pips)
- val -= pips;
- res += val;
- d++;
- } while (d < times);
+ while (times--)
+ res += _rnd.getRandomNumberRng(1, pips);
return res;
}