summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 9e8f6b578..25aae5ec0 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3616,7 +3616,8 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
}
if (target->type == BL_PC) {
struct map_session_data *tsd = (struct map_session_data *)target;
- if(tsd->autospell2_id > 0 && rand()%100 < tsd->autospell2_rate) {
+ if(tsd && ((sd && !sd->state.arrow_atk) || (status_get_range(src)<=2)) &&
+ tsd->autospell2_id > 0 && rand()%100 < tsd->autospell2_rate) {
int skilllv = tsd->autospell_lv,i,f=0,sp;
i = rand()%100;
if(i >= 50) skilllv -= 2;