summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuzZza <LuzZza@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-21 22:18:03 +0000
committerLuzZza <LuzZza@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-21 22:18:03 +0000
commit70f387b43072f65bd8a44b6d9065be6f8e1c907a (patch)
treedcaf460cf35aac4e6fe60e64d11fa08fc02626f2 /src
parent8334acc1e4991b02a5f963a546aed211659522b1 (diff)
downloadhercules-70f387b43072f65bd8a44b6d9065be6f8e1c907a.tar.gz
hercules-70f387b43072f65bd8a44b6d9065be6f8e1c907a.tar.bz2
hercules-70f387b43072f65bd8a44b6d9065be6f8e1c907a.tar.xz
hercules-70f387b43072f65bd8a44b6d9065be6f8e1c907a.zip
Fixed duel in pk-mode (same party/same guild/alliance non-targeting issue).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5696 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 22778f836..de9a7d636 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3436,6 +3436,7 @@ int battle_check_undead(int race,int element)
int battle_check_target( struct block_list *src, struct block_list *target,int flag)
{
int m,state = 0; //Initial state none
+ int is_duel = 0; //Duel flag (see pk-mode checks)
int strip_enemy = 1; //Flag which marks whether to remove the BCT_ENEMY status if it's also friend/ally.
struct block_list *s_bl= src, *t_bl= target;
@@ -3557,6 +3558,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
{
state |= BCT_ENEMY;
strip_enemy = 0;
+ is_duel = 1;
} else if (t_bl != s_bl) {
// You can't target anything out of your duel
return 0;
@@ -3646,7 +3648,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
state |= BCT_ENEMY;
}
if (state&BCT_ENEMY && battle_config.pk_mode && !map_flag_gvg(m) &&
- s_bl->type == BL_PC && t_bl->type == BL_PC)
+ s_bl->type == BL_PC && t_bl->type == BL_PC && !is_duel) //+check for duel [LuzZza]
{ //Prevent novice engagement on pk_mode (feature by Valaris)
struct map_session_data* sd = (struct map_session_data*)s_bl,
*sd2 = (struct map_session_data*)t_bl;
@@ -3666,13 +3668,13 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
} else { //Non pvp/gvg, check party/guild settings.
if (flag&BCT_PARTY || state&BCT_ENEMY) {
int s_party = status_get_party_id(s_bl);
- if (s_party && s_party ==status_get_party_id(t_bl))
+ if(!is_duel s_party && s_party ==status_get_party_id(t_bl)) // +check for duel [LuzZza]
state |= BCT_PARTY;
}
if (flag&BCT_GUILD || state&BCT_ENEMY) {
int s_guild = status_get_guild_id(s_bl);
int t_guild = status_get_guild_id(t_bl);
- if (s_guild && t_guild && (s_guild == t_guild || guild_idisallied(s_guild, t_guild)))
+ if(!is_duel && s_guild && t_guild && (s_guild == t_guild || guild_idisallied(s_guild, t_guild))) //+check for duel [LuzZza]
state |= BCT_GUILD;
}
}