diff options
author | shennetsind <ind@henn.et> | 2013-07-08 19:41:38 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-07-08 19:41:38 -0300 |
commit | 606a98573346c984dc36be3b2db67fb9f0da1d03 (patch) | |
tree | abd37b4c5df2eae513759ebe0ce91f93d2fb63ee /src/map/itemdb.c | |
parent | dd27006f29799a476759496320b389ccece9f1fb (diff) | |
download | hercules-606a98573346c984dc36be3b2db67fb9f0da1d03.tar.gz hercules-606a98573346c984dc36be3b2db67fb9f0da1d03.tar.bz2 hercules-606a98573346c984dc36be3b2db67fb9f0da1d03.tar.xz hercules-606a98573346c984dc36be3b2db67fb9f0da1d03.zip |
Extended 'ID<item_id>' syntax to item packages and item groups.
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r-- | src/map/itemdb.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 08350e3be..5dee2bb00 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -684,7 +684,10 @@ void itemdb_read_groups(void) { } else itname = config_setting_get_string_elem(itg,c - 1); - if( !( data = itemdb->name2id(itname) ) ) + if( itname[0] == 'I' && itname[1] == 'D' && strlen(itname) < 7 ) { + if( !( data = itemdb->exists(atoi(itname+2)) ) ) + ShowWarning("itemdb_read_groups: unknown item ID '%d' in group '%s'!\n",atoi(itname+2),config_setting_name(itg)); + } else if( !( data = itemdb->name2id(itname) ) ) ShowWarning("itemdb_read_groups: unknown item '%s' in group '%s'!\n",itname,config_setting_name(itg)); itemdb->groups[count].nameid[ecount] = data ? data->nameid : 0; @@ -1033,7 +1036,10 @@ void itemdb_read_packages(void) { itname = config_setting_name(it); - if( !( data = itemdb->name2id(itname) ) ) + if( itname[0] == 'I' && itname[1] == 'D' && strlen(itname) < 7 ) { + if( !( data = itemdb->exists(atoi(itname+2)) ) ) + ShowWarning("itemdb_read_packages: unknown item ID '%d' in package '%s'!\n",atoi(itname+2),config_setting_name(itg)); + } else if( !( data = itemdb->name2id(itname) ) ) ShowWarning("itemdb_read_packages: unknown item '%s' in package '%s'!\n",itname,config_setting_name(itg)); if( ( t = config_setting_get_member(it, "Count")) ) |