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.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 7f460e507..b43112109 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5545,17 +5545,12 @@ 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) {
- int fail_flag = 1;
- if(inf2 & INF2_PARTY_ONLY && battle_check_target(src, target, BCT_PARTY) > 0)
- fail_flag = 0;
- else if(inf2 & INF2_GUILD_ONLY && battle_check_target(src, target, BCT_GUILD) > 0)
- fail_flag = 0;
-
- if (ud->skillid == PF_SOULCHANGE && map_flag_vs(target->m))
- //Soul Change overrides this restriction during pvp/gvg [Skotlex]
- fail_flag = 0;
-
- if(fail_flag)
+ 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;
}