diff options
-rw-r--r-- | Changelog-Trunk.txt | 2 | ||||
-rw-r--r-- | 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;
}
}
|