summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-11-18 10:43:18 +0100
committerHaru <haru@dotalux.com>2015-11-18 10:43:18 +0100
commit65b98bffd739778583e4c66f50e6e82f023a2a67 (patch)
tree980110b5866a641ef5d5befa10e0a5e2f4658800 /src/map/skill.c
parente44e4a31d80b1147e233b809d88d5115f21a10ca (diff)
downloadhercules-65b98bffd739778583e4c66f50e6e82f023a2a67.tar.gz
hercules-65b98bffd739778583e4c66f50e6e82f023a2a67.tar.bz2
hercules-65b98bffd739778583e4c66f50e6e82f023a2a67.tar.xz
hercules-65b98bffd739778583e4c66f50e6e82f023a2a67.zip
Fixed a crash in some skills' multi-hit code
- The crash could happen when Land Protector is cast as result of a Fire Wall hit. - Fixes #698 (fix based on ultramage's suggestion) - The fix was also applied to the Taekwon Master's Warmth skills that, while not affected by Land Protector, use a very similar multi-hit loop. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index cdf1c031f..8984bf0fa 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -11878,8 +11878,8 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
//Take into account these hit more times than the timer interval can handle.
do
skill->attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick+count*sg->interval,0);
- while(--src->val2 && x == bl->x && y == bl->y
- && ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status->isdead(bl));
+ while (src->alive != 0 && --src->val2 != 0 && x == bl->x && y == bl->y
+ && ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status->isdead(bl));
if (src->val2<=0)
skill->delunit(src);
@@ -11961,8 +11961,8 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
sg->limit = DIFF_TICK32(tick,sg->tick);
break;
}
- } while( x == bl->x && y == bl->y && sg->alive_count
- && ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status->isdead(bl) );
+ } while (src->alive != 0 && x == bl->x && y == bl->y && sg->alive_count != 0
+ && ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status->isdead(bl));
map->freeblock_unlock();
}
break;