summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAncyker <ancyker@gmail.com>2015-06-27 17:47:13 -0400
committerHaru <haru@dotalux.com>2015-10-02 00:37:52 +0200
commit5edf0c3473f5194e9872c516159b8bc971d095b5 (patch)
treede53a37eb3530855cf0c87c4dac91b04d1aab8bf
parentf6574152b049f6c5d7370e600b4c5b07cbcae13c (diff)
downloadhercules-5edf0c3473f5194e9872c516159b8bc971d095b5.tar.gz
hercules-5edf0c3473f5194e9872c516159b8bc971d095b5.tar.bz2
hercules-5edf0c3473f5194e9872c516159b8bc971d095b5.tar.xz
hercules-5edf0c3473f5194e9872c516159b8bc971d095b5.zip
Fixed crash in SC_GENSOU
SP can be zero. HP probably not, but just in case.
-rw-r--r--src/map/status.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 3ba80e531..c815eeaff 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -8960,6 +8960,9 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
{
int hp = status_get_hp(bl), sp = status_get_sp(bl), lv = 5;
+ if (sp < 1) sp = 1;
+ if (hp < 1) hp = 1;
+
if( rnd()%100 > (25 + 10 * val1) - status_get_int(bl) / 2)
return 0;