diff options
author | Ancyker <ancyker@gmail.com> | 2015-06-27 17:47:13 -0400 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-10-02 00:37:52 +0200 |
commit | 5edf0c3473f5194e9872c516159b8bc971d095b5 (patch) | |
tree | de53a37eb3530855cf0c87c4dac91b04d1aab8bf /src/map/status.c | |
parent | f6574152b049f6c5d7370e600b4c5b07cbcae13c (diff) | |
download | hercules-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.
Diffstat (limited to 'src/map/status.c')
-rw-r--r-- | src/map/status.c | 3 |
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; |