summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorMadCamel <madcamel@gmail.com>2009-08-29 20:43:53 -0400
committerMadCamel <madcamel@gmail.com>2009-08-29 20:45:59 -0400
commit837194519b2be29aa7665828e4d7cb8035fe1c3b (patch)
tree6aefce861fe537c58a585c5ec6e353331891e1ba /src/map/clif.c
parentde294e7c7d5ccf129eea3ce45c8023fa7b6d371d (diff)
downloadtmwa-837194519b2be29aa7665828e4d7cb8035fe1c3b.tar.gz
tmwa-837194519b2be29aa7665828e4d7cb8035fe1c3b.tar.bz2
tmwa-837194519b2be29aa7665828e4d7cb8035fe1c3b.tar.xz
tmwa-837194519b2be29aa7665828e4d7cb8035fe1c3b.zip
Converted to Mersenne Twister for random.
Randomerer! Also: Fixed a security problem. Can you find it?
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index a53177d..aa7fea4 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3369,9 +3369,9 @@ int clif_damage(struct block_list *src,struct block_list *dst,unsigned int tick,
type = 9;
if(sc_data[SC_HALLUCINATION].timer != -1) {
if(damage > 0)
- damage = damage*(5+sc_data[SC_HALLUCINATION].val1) + rand()%100;
+ damage = damage*(5+sc_data[SC_HALLUCINATION].val1) + MRAND(100);
if(damage2 > 0)
- damage2 = damage2*(5+sc_data[SC_HALLUCINATION].val1) + rand()%100;
+ damage2 = damage2*(5+sc_data[SC_HALLUCINATION].val1) + MRAND(100);
}
}
@@ -3881,7 +3881,7 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst,
if(type != 5 && sc_data[SC_ENDURE].timer != -1)
type = 9;
if(sc_data[SC_HALLUCINATION].timer != -1 && damage > 0)
- damage = damage*(5+sc_data[SC_HALLUCINATION].val1) + rand()%100;
+ damage = damage*(5+sc_data[SC_HALLUCINATION].val1) + MRAND(100);
}
WBUFW(buf,0)=0x1de;
@@ -3921,7 +3921,7 @@ int clif_skill_damage2(struct block_list *src,struct block_list *dst,
if(type != 5 && sc_data[SC_ENDURE].timer != -1)
type = 9;
if(sc_data[SC_HALLUCINATION].timer != -1 && damage > 0)
- damage = damage*(5+sc_data[SC_HALLUCINATION].val1) + rand()%100;
+ damage = damage*(5+sc_data[SC_HALLUCINATION].val1) + MRAND(100);
}
WBUFW(buf,0)=0x115;