From 3c9a4b95c3612e0925baf1b116460e0c07cd6d2f Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 12 Jun 2006 21:14:28 +0000 Subject: - Fixed npc_checknear's distance check returning the opposite of what it should (false when the range is correct and viceversa) - SL_STIN/SL_STUN have dex-reducable casting times now. - Added a warning on item loading when an item is of equippable type but has no equippable position. - Turning an alliance to an opposition won't work now during WoE - Slaves can summon other mobs now. The only ones who can't do this are player summoned mobs. - Merged the following functions for faster processing of items: clif_storageitemlist + clif_storageequiplist = clif_storagelist clif_guildstorageitemlist + clif_guildstorageequiplist = clif_guildstoragelist clif_itemlist + clif_equiplist = clif_inventorylist - Increased max knockback value support to 25. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7109 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/itemdb.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'src/map/itemdb.c') diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 603f20849..86c79f52f 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -262,17 +262,32 @@ int itemdb_isequip(int nameid) *------------------------------------------ */ int itemdb_isequip2(struct item_data *data) -{ - if(data) { - int type=data->type; - if(type==0 || type==2 || type==3 || type==6 || type==10) +{ + nullpo_retr(0, data); + switch(data->type) { + case 0: + case 2: + case 3: + case 6: + case 10: return 0; - else + default: return 1; } - return 0; +} +//Checks if the item is pet-equipment (7/8) +static int itemdb_ispetequip(struct item_data *data) +{ + switch(data->type) { + case 7: + case 8: + return 1; + default: + return 0; + } } + /*========================================== * Trade Restriction functions [Skotlex] *------------------------------------------ @@ -584,7 +599,7 @@ static int itemdb_read_itemslottable(void) struct item_data* item; sscanf(p, "%d#%d#", &nameid, &equip); item = itemdb_search(nameid); - if (item && itemdb_isequip2(item)) + if (equip && item && itemdb_isequip2(item)) item->equip = equip; p = strchr(p, 10); if(!p) break; @@ -852,6 +867,11 @@ static int itemdb_read_sqldb(void) id->class_upper= (sql_row[12] != NULL) ? atoi(sql_row[12]) : 0; id->sex = (sql_row[13] != NULL) ? atoi(sql_row[13]) : 0; id->equip = (sql_row[14] != NULL) ? atoi(sql_row[14]) : 0; + if (!id->equip && itemdb_isequip2(id) && !itemdb_ispetequip(id)) + { + ShowWarning("Item %d (%s) is an equipment with no equip-field! Making it an etc item.\n", nameid, id->jname); + id->type = 3; + } id->wlv = (sql_row[15] != NULL) ? atoi(sql_row[15]) : 0; id->elv = (sql_row[16] != NULL) ? atoi(sql_row[16]) : 0; id->flag.no_refine = (sql_row[17] == NULL || atoi(sql_row[17]) == 1)?0:1; @@ -1019,6 +1039,11 @@ static int itemdb_readdb(void) if(id->equip != atoi(str[14])){ id->equip=atoi(str[14]); } + if (!id->equip && itemdb_isequip2(id) && !itemdb_ispetequip(id)) + { + ShowWarning("Item %d (%s) is an equipment with no equip-field! Making it an etc item.\n", nameid, id->jname); + id->type = 3; + } id->wlv=atoi(str[15]); id->elv=atoi(str[16]); id->flag.no_refine = atoi(str[17])?0:1; //If the refine column is 1, no_refine is 0 -- cgit v1.2.3-60-g2f50