diff options
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r-- | src/map/itemdb.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 386f38c5a..0b4419e0c 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -727,6 +727,31 @@ static bool itemdb_read_buyingstore(char* fields[], int columns, int current) return true; } + +/******************************************* +** Item usage restriction (item_nouse.txt) +********************************************/ +static bool itemdb_read_nouse(char* fields[], int columns, int current) +{// <nameid>,<flag>,<override> + int nameid, flag, override; + struct item_data* id; + + nameid = atoi(fields[0]); + + if( ( id = itemdb_exists(nameid) ) == NULL ) { + ShowWarning("itemdb_read_nouse: Invalid item id %d.\n", nameid); + return false; + } + + flag = atoi(fields[1]); + override = atoi(fields[2]); + + id->item_usage.flag = flag; + id->item_usage.override = override; + + return true; +} + /** * @return: amount of retrieved entries. **/ @@ -1304,6 +1329,7 @@ static void itemdb_read(void) { sv_readdb(db_path, "item_delay.txt", ',', 2, 2, -1, &itemdb_read_itemdelay); sv_readdb(db_path, "item_stack.txt", ',', 3, 3, -1, &itemdb_read_stack); sv_readdb(db_path, DBPATH"item_buyingstore.txt", ',', 1, 1, -1, &itemdb_read_buyingstore); + sv_readdb(db_path, "item_nouse.txt", ',', 3, 3, -1, &itemdb_read_nouse); itemdb_uid_load(); } |