Pārlūkot izejas kodu

Fixed bugreport:8468, http://rathena.org/board/tracker/issue-8468-item-not-exist-using-dummy-data/

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
Cydh Ramdh 11 gadi atpakaļ
vecāks
revīzija
1ba024069a
1 mainītis faili ar 6 papildinājumiem un 3 dzēšanām
  1. 6 3
      src/map/clif.c

+ 6 - 3
src/map/clif.c

@@ -66,9 +66,12 @@ struct Clif_Config {
 struct s_packet_db packet_db[MAX_PACKET_VER + 1][MAX_PACKET_DB + 1];
 int packet_db_ack[MAX_PACKET_VER + 1][MAX_ACK_FUNC + 1];
 
-//Converts item type in case of pet eggs/shadow equip.
-static inline int itemtype(int item_id) {
-	struct item_data* id = itemdb_exists(item_id);
+/** Converts item type to display it on client if necessary.
+* @param nameid: Item ID
+* @return item type. For IT_PETEGG will be displayed as IT_WEAPON. If Shadow Weapon of IT_SHADOWGEAR as IT_WEAPON and else as IT_ARMOR
+*/
+static inline int itemtype(int nameid) {
+	struct item_data* id = itemdb_search(nameid); //Use itemdb_search, so non-existance item will use dummy data and won't crash the server. bugreport:8468
 	int type = id->type;
 	if( type == IT_SHADOWGEAR ) {
 		if( id->equip&EQP_SHADOW_WEAPON )