Преглед на файлове

- itemdb_exists will now return NULL for item_id 0.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7572 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex преди 19 години
родител
ревизия
41e3ff9044
променени са 2 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 1 0
      Changelog-Trunk.txt
  2. 3 1
      src/map/itemdb.c

+ 1 - 0
Changelog-Trunk.txt

@@ -4,6 +4,7 @@ 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/07/07
+	* itemdb_exists will now return NULL for item_id 0. [Skotlex]
 	* Added a check to free a character from memory when changing map servers.
 	  [Skotlex]
 	* Okay, added a chrif_save_ack packet to the char-server so now the map

+ 3 - 1
src/map/itemdb.c

@@ -134,7 +134,9 @@ int itemdb_group (int nameid)
  */
 struct item_data* itemdb_exists(int nameid)
 {
-	struct item_data* id = idb_get(item_db,nameid);
+	struct item_data* id;
+	if (!nameid) return NULL;
+	id = idb_get(item_db,nameid);
 //	if (id == &dummy_item) return NULL; //Let dummy items go through... technically they "exist" because someone already has them...
 	return id;
 }