From 5b24315ae353c051415fd878c4a2817c94b6a245 Mon Sep 17 00:00:00 2001 From: ai4rei Date: Sat, 8 Jan 2011 12:25:59 +0000 Subject: * Fixed kill steal protection result in skill casting (unit_skilluse_id2) not getting evaluated (bugreport:1808, since r12203). - Moved kill steal protection in skill casting to be only executed, after the actual target has been determined and validated (since r12203). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14658 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/unit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/map/unit.c b/src/map/unit.c index df4efef8e..3b3dd0e5f 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -939,8 +939,6 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh if(skillnotok(skill_num, sd)) // [MouseJstr] return 0; - mob_ksprotected(src, map_id2bl(target_id)); - switch(skill_num) { //Check for skills that auto-select target case MO_CHAINCOMBO: @@ -987,6 +985,9 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh if( !target || src->m != target->m || !src->prev || !target->prev ) return 0; + if( mob_ksprotected(src, target) ) + return 0; + //Normally not needed because clif.c checks for it, but the at/char/script commands don't! [Skotlex] if(ud->skilltimer != -1 && skill_num != SA_CASTCANCEL) return 0; -- cgit v1.2.3-70-g09d2