From a444f55f1448cfb3b14f9019fd73b684e6a9f322 Mon Sep 17 00:00:00 2001 From: Fate Date: Wed, 3 Dec 2008 21:25:30 -0700 Subject: Replaced use of rand()%range by peavey's MRAND() macro after complaints about script randomness --- src/map/clif.c | 2 +- src/map/script.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 2858e50..ab64c2d 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2583,7 +2583,7 @@ int clif_changestatus(struct block_list *bl,int type,int val) */ int clif_changelook(struct block_list *bl,int type,int val) { - clif_changelook_towards(bl, type, val, NULL); + return clif_changelook_towards(bl, type, val, NULL); } int clif_changelook_towards(struct block_list *bl,int type,int val, struct map_session_data *dstsd) 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; } -- cgit v1.2.3-70-g09d2