summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-08-02 04:10:23 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-08-02 04:10:23 +0000
commit7af299d591f357471bc8447707a10de9ea5ae0e3 (patch)
tree3a42528f874f1da21ee8aaf552da82181c01bcf7 /src/map/skill.c
parent73b9ce7e5d16ef9c2aa639c8442dd8f15c615fca (diff)
downloadhercules-7af299d591f357471bc8447707a10de9ea5ae0e3.tar.gz
hercules-7af299d591f357471bc8447707a10de9ea5ae0e3.tar.bz2
hercules-7af299d591f357471bc8447707a10de9ea5ae0e3.tar.xz
hercules-7af299d591f357471bc8447707a10de9ea5ae0e3.zip
* 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
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c18
1 files changed, 7 insertions, 11 deletions
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);