فهرست منبع

Fixed duel in pk-mode (same party/same guild/alliance non-targeting issue).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5696 54d463be-8e91-2dee-dedb-b68131a5f0ec
LuzZza 19 سال پیش
والد
کامیت
aac4ec9ab4
2فایلهای تغییر یافته به همراه7 افزوده شده و 3 حذف شده
  1. 2 0
      Changelog-Trunk.txt
  2. 5 3
      src/map/battle.c

+ 2 - 0
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]

+ 5 - 3
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;
 		}
 	}