From 1ba024069a0a70e3c883daff1947f3d181bd4b5d Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Tue, 21 Jan 2014 19:18:19 +0700 Subject: [PATCH] Fixed bugreport:8468, http://rathena.org/board/tracker/issue-8468-item-not-exist-using-dummy-data/ Signed-off-by: Cydh Ramdh --- src/map/clif.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 2e0479dc58..86be59ba00 100644 --- a/src/map/clif.c +++ b/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 )