浏览代码

- Corrected script_commands description of getequipid, it returns -1, not 0 on fail.
- Fixed the mob-id check during pet_db loading, it will also now print when a pet is not loaded due to having an invalid mob class specified.


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

skotlex 18 年之前
父节点
当前提交
a9e7abfc20
共有 3 个文件被更改,包括 12 次插入4 次删除
  1. 4 0
      Changelog-Trunk.txt
  2. 1 1
      doc/script_commands.txt
  3. 7 3
      src/map/pet.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ 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/09/01
+	* Corrected script_commands description of getequipid, it returns -1, not 0
+	  on fail. [Skotlex]
+	* Fixed the mob-id check during pet_db loading, it will also now print when
+	  a pet is not loaded due to having an invalid mob class specified. [Skotlex]
 	* The "delete_timer error/no such timer" report will now print the related function [Toms]
 	* The Clearing unused stack report will now print the related NPC [Toms]
 	* The duplicate npc report will now print the related file name [Toms]

+ 1 - 1
doc/script_commands.txt

@@ -2211,7 +2211,7 @@ returned when requesting that information.
 *getequipid(<equipment slot>)
 
 This function returns the item ID of the item equipped in the equipment slot 
-specified on the invoking character. If nothing is equpped there, it returns 0. 
+specified on the invoking character. If nothing is equpped there, it returns -1. 
 Valid equipment slots are:
 
 1  - Upper head gear

+ 7 - 3
src/map/pet.c

@@ -1308,10 +1308,14 @@ int read_petdb()
 			}
 
 			nameid=atoi(str[0]);
-			if(nameid<=0 || nameid>2000)
+			if(nameid<=0)
 				continue;
-		
-			//MobID,Name,JName,ItemID,EggID,AcceID,FoodID,"Fullness (1回の餌での満腹度増加率%)","HungryDeray (/min)","R_Hungry (空腹時餌やり親密度増加率%)","R_Full (とても満腹時餌やり親密度減少率%)","Intimate (捕獲時親密度%)","Die (死亡時親密度減少率%)","Capture (捕獲率%)",(Name)
+
+			if (!mobdb_checkid(nameid)) {
+				ShowWarning("pet_db reading: Invalid mob-class %d, pet not read.\n", nameid);
+				continue;
+			}
+
 			pet_db[j].class_ = nameid;
 			memcpy(pet_db[j].name,str[1],NAME_LENGTH-1);
 			memcpy(pet_db[j].jname,str[2],NAME_LENGTH-1);