diff options
author | shennetsind <ind@henn.et> | 2013-07-08 19:34:21 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-07-08 19:34:21 -0300 |
commit | dd27006f29799a476759496320b389ccece9f1fb (patch) | |
tree | d0abb7384318f63e26d1e84286ebb82cce975c31 | |
parent | 4b0a216da38d3c704315ce8c43592068de5781c2 (diff) | |
download | hercules-dd27006f29799a476759496320b389ccece9f1fb.tar.gz hercules-dd27006f29799a476759496320b389ccece9f1fb.tar.bz2 hercules-dd27006f29799a476759496320b389ccece9f1fb.tar.xz hercules-dd27006f29799a476759496320b389ccece9f1fb.zip |
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 <ind@henn.et>
-rw-r--r-- | src/map/itemdb.c | 7 |
1 files changed, 6 insertions, 1 deletions
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(); |