Pārlūkot izejas kodu

- Updated max_def parameter to not apply to mdef if magic_defense_type is set (rather than weapon_defense_type)
- Updated comment description for config setting max_def
- Fixed battle_check_target check on BCT_ALL to check versus BL_CHAR instead of BL_PC and BL_MOB


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6826 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 19 gadi atpakaļ
vecāks
revīzija
d69e247829
4 mainītis faili ar 9 papildinājumiem un 7 dzēšanām
  1. 2 0
      Changelog-Trunk.txt
  2. 3 1
      conf-tmpl/battle/player.conf
  3. 3 5
      src/map/battle.c
  4. 1 1
      src/map/status.c

+ 2 - 0
Changelog-Trunk.txt

@@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/05/29
+	* Fixed battle_check_target check on BCT_ALL to check versus BL_CHAR
+	  instead of BL_PC and BL_MOB [Skotlex]
 	* [Fixed]:
 	  - Declaration of int map_getcellp(struct map_data*,int,int,cell_t);
 	* Removed Undead being inmune to poison status. [Skotlex]

+ 3 - 1
conf-tmpl/battle/player.conf

@@ -100,8 +100,10 @@ max_parameter: 99
 // Same as max_parameter, but for baby classes.
 max_baby_parameter: 80
 
-// Max armor def/mdef (applies only if player_defense_type is 0)
+// Max armor def/mdef 
 // NOTE: does not affects skills and status effects like Mental Strength
+// If weapon_defense_type is non-zero, it won't apply to max def.
+// If magic_defense_type is non-zero, it won't apply to max mdef.
 max_def: 99
 
 // Def to Def2 conversion bonus. If the armor def/mdef exceeds max_def,

+ 3 - 5
src/map/battle.c

@@ -25,8 +25,6 @@
 #include "guild.h"
 #include "party.h"
 
-#include "mercenary.h"
-
 #define	is_boss(bl)	status_get_mexp(bl)	// Can refine later [Aru]
 
 int attr_fix_table[4][10][10];
@@ -3154,7 +3152,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
 			if (t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai)
 				state |= BCT_ENEMY; //Default enemy. Normal mobs.
 			//Pass on to master.
-			s_bl=(struct block_list *)((struct homun_data*)src)->master;	//Whoever is the master's enemy is the homunculus' enemy.
+			s_bl=(struct block_list *)((struct homun_data*)src)->master;
 			break;
 		}
 		case BL_PET:
@@ -3176,8 +3174,8 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
 			return 0;
 	}
 	
-	if ((flag&BCT_ALL) == BCT_ALL) { //All actually stands for all players/mobs
-		if (target->type == BL_MOB || target->type == BL_PC)
+	if ((flag&BCT_ALL) == BCT_ALL) { //All actually stands for all attackable chars 
+		if (target->type&BL_CHAR)
 			return 1;
 		else
 			return -1;

+ 1 - 1
src/map/status.c

@@ -1718,7 +1718,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
 	if(sd->mdef_rate != 100)
 		status->mdef = status->mdef * sd->mdef_rate/100;
 
-	if (!battle_config.weapon_defense_type && status->mdef > battle_config.max_def)
+	if (!battle_config.magic_defense_type && status->mdef > battle_config.max_def)
 	{
 		status->mdef2 += battle_config.over_def_bonus*(status->mdef -battle_config.max_def);
 		status->mdef = (unsigned char)battle_config.max_def;