From 26bc0cf56b4867fab222a15de18ac43ff799b9e8 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 15 Mar 2014 19:05:23 -0300 Subject: Fixed Bug 8089 In the scenario where damage is reflected and kills the caste sc->data[SC__SHADOWFORM] would be null (caster no longer is under the condition) and thus the crash. http://hercules.ws/board/tracker/issue-8089-map-crash/ Signed-off-by: shennetsind --- src/map/skill.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/map') diff --git a/src/map/skill.c b/src/map/skill.c index 7f33c26a5..554528af2 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -15327,7 +15327,9 @@ bool skill_check_shadowform(struct block_list *bl, int64 damage, int hit){ } status->damage(bl, src, damage, 0, clif->damage(src, src, 500, 500, damage, hit, (hit > 1 ? 8 : 0), 0), 0); - if( (--sc->data[SC__SHADOWFORM]->val3) <= 0 ) { + + /* because damage can cancel it */ + if( sc->data[SC__SHADOWFORM] && (--sc->data[SC__SHADOWFORM]->val3) <= 0 ) { status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER); if( src->type == BL_PC ) ((TBL_PC*)src)->shadowform_id = 0; -- cgit v1.2.3-70-g09d2