From dd27006f29799a476759496320b389ccece9f1fb Mon Sep 17 00:00:00 2001 From: shennetsind Date: Mon, 8 Jul 2013 19:34:21 -0300 Subject: Modified how itemdb->names is populated Not only does it fix the itemdb2 name override problem, its also more efficient :P Special Thanks to kyeme for bringing this issue to our attention Signed-off-by: shennetsind --- src/map/itemdb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/map/itemdb.c b/src/map/itemdb.c index d4fbcb121..08350e3be 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -1687,7 +1687,6 @@ int itemdb_parse_dbrow(char** str, const char* source, int line, int scriptopt) if (*str[21+offset]) id->unequip_script = parse_script(str[21+offset], source, line, scriptopt); - strdb_put(itemdb->names, id->name, id); return id->nameid; } @@ -1914,11 +1913,17 @@ int itemdb_uid_load() { * read all item-related databases *------------------------------------*/ static void itemdb_read(void) { + int i; + if (iMap->db_use_sql_item_db) itemdb_read_sqldb(); else itemdb_readdb(); + for( i = 0; i < ARRAYLENGTH(itemdb_array); ++i ) + if( itemdb_array[i] ) + strdb_put(itemdb->names, itemdb_array[i]->name, itemdb_array[i]); + itemdb_read_combos(); itemdb->read_groups(); itemdb->read_chains(); -- cgit v1.2.3-70-g09d2