summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-11-05 21:13:14 +0100
committerHaru <haru@dotalux.com>2017-11-05 21:13:14 +0100
commit3edcd549cee863ecc8a2a96dfb5bbb56d435d97a (patch)
treec08ceaa38363344110bb0d2b7b4e556e3a88c436 /src/map/script.c
parent09d5c20572424e7a92dff5cf560001278c6ffaa0 (diff)
downloadhercules-3edcd549cee863ecc8a2a96dfb5bbb56d435d97a.tar.gz
hercules-3edcd549cee863ecc8a2a96dfb5bbb56d435d97a.tar.bz2
hercules-3edcd549cee863ecc8a2a96dfb5bbb56d435d97a.tar.xz
hercules-3edcd549cee863ecc8a2a96dfb5bbb56d435d97a.zip
Fix/clarify various incorrect modulo operations
Most relevantly, `skill_lv%11 - 1` is not a valid skill item requirement index, since it can return -1 depending on the skill_lv. It was replaced with `(skill_lv - 1) % MAX_SKILL_ITEM_REQUIRE`, which always returns a value in the 0 ~ MAX_SKILL_ITEM_REQUIRE range. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index f72b54a0d..a836501f7 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -12190,7 +12190,7 @@ BUILDIN(homunculus_mutate)
if (script_hasdata(st,2))
homun_id = script_getnum(st,2);
else
- homun_id = 6048 + (rnd() % 4);
+ homun_id = HOMID_EIRA + (rnd() % 4);
m_class = homun->class2type(sd->hd->homunculus.class_);
m_id = homun->class2type(homun_id);