summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2008-12-03 21:25:30 -0700
committerFate <fate-tmw@googlemail.com>2008-12-03 21:25:30 -0700
commita444f55f1448cfb3b14f9019fd73b684e6a9f322 (patch)
tree843fb89853da604200dccb60fb8dc7fd06b0c57b /src/map/script.c
parent1efdef1c054419ba1a0c8ee8836c5737228d579a (diff)
downloadtmwa-a444f55f1448cfb3b14f9019fd73b684e6a9f322.tar.gz
tmwa-a444f55f1448cfb3b14f9019fd73b684e6a9f322.tar.bz2
tmwa-a444f55f1448cfb3b14f9019fd73b684e6a9f322.tar.xz
tmwa-a444f55f1448cfb3b14f9019fd73b684e6a9f322.zip
Replaced use of rand()%range by peavey's MRAND() macro after complaints about script randomness
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c
index df033f9..4cbeb38 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -1697,10 +1697,10 @@ int buildin_rand(struct script_state *st)
max=tmp;
}
range=max-min+1;
- push_val(st->stack,C_INT,(range <= 0 ? 0 : rand()%range) + min);
+ push_val(st->stack,C_INT,(range <= 0 ? 0 : MRAND(range)) + min);
} else {
range=conv_num(st,& (st->stack->stack_data[st->start+2]));
- push_val(st->stack,C_INT,range <= 0 ? 0 : rand()%range);
+ push_val(st->stack,C_INT,range <= 0 ? 0 : MRAND(range));
}
return 0;
}