From 7af299d591f357471bc8447707a10de9ea5ae0e3 Mon Sep 17 00:00:00 2001 From: Inkfish Date: Sun, 2 Aug 2009 04:10:23 +0000 Subject: * Questlog code cleanup. * Fixed range check of autospell and autospell2 using wrong target when it should be used on yourself. * Implemented official behavior of party_show_share_picker. * Restricted zones in 'item_noequip.txt' can now stack. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13987 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/skill.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/map/skill.c') diff --git a/src/map/skill.c b/src/map/skill.c index 4629e9f6e..6509eaddb 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1010,13 +1010,10 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int if (rand()%1000 > rate) continue; - if( !battle_check_range(src, bl, skill_get_range2(src, skill,skilllv) + (skill == RG_CLOSECONFINE?0:1)) ) - continue; //Autocasts should always fail if the target is outside the skill range or an obstacle is in between.[Inkfish] + tbl = (sd->autospell[i].id < 0) ? src : bl; - if (sd->autospell[i].id < 0) - tbl = src; - else - tbl = bl; + if( !battle_check_range(src, tbl, skill_get_range2(src, skill,skilllv) + (skill == RG_CLOSECONFINE?0:1)) ) + continue; //Autocasts should always fail if the target is outside the skill range or an obstacle is in between.[Inkfish] sd->state.autocast = 1; skill_consume_requirement(sd,skill,skilllv,1); @@ -1275,12 +1272,11 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list * continue; if (rand()%1000 > rate) continue; - if( !battle_check_range(src, bl, skill_get_range2(src, skillid,skilllv) + (skillid == RG_CLOSECONFINE?0:1)) ) + + tbl = (dstsd->autospell2[i].id < 0) ? bl : src; + + if( !battle_check_range(src, tbl, skill_get_range2(src, skillid,skilllv) + (skillid == RG_CLOSECONFINE?0:1)) ) continue; - if (dstsd->autospell2[i].id < 0) - tbl = bl; - else - tbl = src; dstsd->state.autocast = 1; skill_consume_requirement(dstsd,skillid,skilllv,1); -- cgit v1.2.3-70-g09d2