aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSebastian Krzyszkowiak2019-06-18 01:43:11 +0200
committerFilippos Karapetis2019-06-18 08:28:38 +0300
commitbbed50ff27a1d4c656a8876f277fe1d8dcfb5f3f (patch)
treee6969b7b09e50554658e08be4c2eb0bcfd853c3c /engines
parentd9c84440f2ec79eca44a8b16a9788b1ead32a79a (diff)
downloadscummvm-rg350-bbed50ff27a1d4c656a8876f277fe1d8dcfb5f3f.tar.gz
scummvm-rg350-bbed50ff27a1d4c656a8876f277fe1d8dcfb5f3f.tar.bz2
scummvm-rg350-bbed50ff27a1d4c656a8876f277fe1d8dcfb5f3f.zip
SLUDGE: implement `random` built-in
Diffstat (limited to 'engines')
-rw-r--r--engines/sludge/builtin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/sludge/builtin.cpp b/engines/sludge/builtin.cpp
index 1030643788..185ff1a23c 100644
--- a/engines/sludge/builtin.cpp
+++ b/engines/sludge/builtin.cpp
@@ -698,7 +698,7 @@ builtIn(random) {
trimStack(fun->stack);
if (num <= 0)
num = 1;
- fun->reg.setVariable(SVT_INT, 0 /*rand() % num*/); //TODO:false value
+ fun->reg.setVariable(SVT_INT, g_sludge->getRandomSource()->getRandomNumber(num - 1));
return BR_CONTINUE;
}