aboutsummaryrefslogtreecommitdiff
path: root/sword2/function.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-10-08 18:02:53 +0000
committerTorbjörn Andersson2003-10-08 18:02:53 +0000
commita29d128bd3b53847de3e89801426dfc19e2ecbc1 (patch)
tree4b1995fcc900709d75877e7ee053092d17b92ad0 /sword2/function.cpp
parenta1f4dc2c90efd28d30eec2b947ffe9d619ad0989 (diff)
downloadscummvm-rg350-a29d128bd3b53847de3e89801426dfc19e2ecbc1.tar.gz
scummvm-rg350-a29d128bd3b53847de3e89801426dfc19e2ecbc1.tar.bz2
scummvm-rg350-a29d128bd3b53847de3e89801426dfc19e2ecbc1.zip
Use RandomSource instead of rand().
svn-id: r10682
Diffstat (limited to 'sword2/function.cpp')
-rw-r--r--sword2/function.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/sword2/function.cpp b/sword2/function.cpp
index 1d8e588861..b3040eff75 100644
--- a/sword2/function.cpp
+++ b/sword2/function.cpp
@@ -135,11 +135,11 @@ int32 FN_random(int32 *params) {
// Generates a random number between 'min' & 'max' inclusive, and
// sticks it in the script flag 'result'
- uint32 min = params[0];
- uint32 max = params[1];
+ // params: 0 min
+ // 1 max
// return_value = random integer between min and max, inclusive
- RESULT = (rand() % (max-min + 1)) + min;
+ RESULT = g_sword2->_rnd.getRandomNumberRng(params[0], params[1]);
// continue script
return IR_CONT;