summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 18715653e..837c5e6a3 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5741,7 +5741,7 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
struct mob_data* md = NULL;
struct unit_data* ud = unit_bl2ud(src);
struct status_change *sc;
- int inf2;
+ int inf,inf2;
nullpo_retr(0, ud);
@@ -5808,11 +5808,23 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
break;
}
} else {
- inf2 = skill_get_inf(ud->skillid);
- if((inf2&INF_ATTACK_SKILL ||
- (inf2&INF_SELF_SKILL && skill_get_inf2(ud->skillid)&INF2_NO_TARGET_SELF)) //Combo skills
- && battle_check_target(src, target, BCT_ENEMY)<=0
+ //Check target validity.
+ inf = skill_get_inf(ud->skillid);
+ inf2 = skill_get_inf2(ud->skillid);
+
+ if((inf&INF_ATTACK_SKILL ||
+ (inf&INF_SELF_SKILL && inf2&INF2_NO_TARGET_SELF)) //Combo skills
)
+ inf = INF_ATTACK_SKILL; //Offensive skill.
+ else
+ inf = 0;
+
+ if(inf2 & (INF2_PARTY_ONLY|INF2_GUILD_ONLY) && src != target)
+ inf |=
+ (inf2&INF2_PARTY_ONLY?BCT_PARTY:0)|
+ (inf2&INF2_GUILD_ONLY?BCT_GUILD:0)|
+ (inf2&INF2_ALLOW_ENEMY?BCT_ENEMY:0);
+ if (inf && battle_check_target(src, target, inf) <= 0)
break;
}
@@ -5831,17 +5843,6 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
}
}
- inf2 = skill_get_inf2(ud->skillid);
- if(inf2 & (INF2_PARTY_ONLY|INF2_GUILD_ONLY) && src != target) {
- inf2 =
- (inf2&INF2_PARTY_ONLY?BCT_PARTY:0)|
- (inf2&INF2_GUILD_ONLY?BCT_GUILD:0)|
- (inf2&INF2_ALLOW_ENEMY?BCT_ENEMY:0);
-
- if(battle_check_target(src, target, inf2) <= 0)
- break;
- }
-
if(src != target && battle_config.skill_add_range &&
!check_distance_bl(src, target, skill_get_range2(src,ud->skillid,ud->skilllv)+battle_config.skill_add_range))
{