From 70f387b43072f65bd8a44b6d9065be6f8e1c907a Mon Sep 17 00:00:00 2001 From: LuzZza Date: Tue, 21 Mar 2006 22:18:03 +0000 Subject: 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 --- Changelog-Trunk.txt | 2 ++ src/map/battle.c | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 0d21ded4b..68b1a89bd 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -5,6 +5,8 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS 2006/03/21 + * Fixed duel in pk-mode (same party/same guild/alliance non-targeting issue). + Thanks to Hobbit for pointing that out. [LuzZza] * Fix on not showing guildmembers logins/logouts messages. [LuzZza] * Fixed SC_SWOO's opt3 value. Small monsters should stay small for skill's duration now. [Skotlex] 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; } } -- cgit v1.2.3-70-g09d2