summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-03-26 17:33:00 +0200
committerGitHub <noreply@github.com>2017-03-26 17:33:00 +0200
commit1eb26bfc0c32864bc3bef0ad7b5d853adda1bed6 (patch)
tree6a0621228577639872ca66ef227e0ac680beb11c
parent446b1815b86c7dcab2102677621feacc2ea602d4 (diff)
parentcb4297e6eb734c60825ebfa13f32989fa3a470eb (diff)
downloadhercules-1eb26bfc0c32864bc3bef0ad7b5d853adda1bed6.tar.gz
hercules-1eb26bfc0c32864bc3bef0ad7b5d853adda1bed6.tar.bz2
hercules-1eb26bfc0c32864bc3bef0ad7b5d853adda1bed6.tar.xz
hercules-1eb26bfc0c32864bc3bef0ad7b5d853adda1bed6.zip
Merge pull request #1649 from HerculesWS/issue-1647-1
Fixes issue #1647
-rw-r--r--src/map/battle.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 77bb99730..8b6ac2cc0 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -6814,14 +6814,23 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
if( flag&(BCT_PARTY|BCT_ENEMY) ) {
int s_party = status->get_party_id(s_bl);
int s_guild = status->get_guild_id(s_bl);
-
- if( s_party && s_party == status->get_party_id(t_bl)
- && !(map->list[m].flag.pvp && map->list[m].flag.pvp_noparty)
- && !(map_flag_gvg(m) && map->list[m].flag.gvg_noparty && !( s_guild && s_guild == status->get_guild_id(t_bl) ))
- && (!map->list[m].flag.battleground || sbg_id == tbg_id) )
- state |= BCT_PARTY;
- else
+ int t_guild = status->get_guild_id(t_bl);
+
+ if (s_party && s_party == status->get_party_id(t_bl)) {
+ if (map_flag_gvg(m) && map->list[m].flag.gvg_noparty && !(s_guild && s_guild == t_guild)) {
+ if (t_guild && guild->isallied(s_guild, t_guild))
+ state |= BCT_PARTY;
+ else
+ state |= flag&BCT_ENEMY ? BCT_ENEMY : BCT_PARTY;
+ } else if (!(map->list[m].flag.pvp && map->list[m].flag.pvp_noparty)
+ && (!map->list[m].flag.battleground || sbg_id == tbg_id)) {
+ state |= BCT_PARTY;
+ } else {
+ state |= BCT_ENEMY;
+ }
+ } else {
state |= BCT_ENEMY;
+ }
}
if( flag&(BCT_GUILD|BCT_ENEMY) ) {
int s_guild = status->get_guild_id(s_bl);