Переглянути джерело

* Fixed pcdb_checkid not recognizing invalid/unused job classes (bugreport:4830, since r14755).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/renewal@14810 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 роки тому
батько
коміт
aa86741f87
2 змінених файлів з 9 додано та 1 видалено
  1. 2 0
      Changelog-Renewal.txt
  2. 7 1
      src/map/pc.h

+ 2 - 0
Changelog-Renewal.txt

@@ -1,5 +1,7 @@
 Date	Added
 
+2011/05/08
+	* Fixed pcdb_checkid not recognizing invalid/unused job classes (bugreport:4830, since r14755). [Ai4rei]
 2011/02/07
 	* Updated enumerations of skill, skill unit and status option IDs. [Ai4rei]
 2011/01/29

+ 7 - 1
src/map/pc.h

@@ -547,7 +547,13 @@ extern int duel_count;
 #define pc_check_weapontype(sd, type) ((type)&((sd)->status.weapon < MAX_WEAPON_TYPE? \
 	1<<(sd)->status.weapon:(1<<(sd)->weapontype1)|(1<<(sd)->weapontype2)))
 //Checks if the given class value corresponds to a player class. [Skotlex]
-#define pcdb_checkid(class_) (class_ < JOB_MAX_BASIC || (class_ >= JOB_NOVICE_HIGH && class_ < JOB_MAX))
+#define pcdb_checkid(class_) \
+( \
+	( (class_) >= JOB_NOVICE      && (class_) <  JOB_MAX_BASIC   ) \
+||	( (class_) >= JOB_NOVICE_HIGH && (class_) <= JOB_SOUL_LINKER ) \
+||	( (class_) >= JOB_RUNE_KNIGHT && (class_) <= JOB_MECHANIC_H2 ) \
+||	( (class_) >= JOB_BABY_RUNE   && (class_) <  JOB_MAX         ) \
+)
 
 int pc_class2idx(int class_);
 int pc_isGM(struct map_session_data *sd);