summaryrefslogtreecommitdiff
path: root/src/map/itemdb.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-05-02 17:15:10 -0300
committershennetsind <ind@henn.et>2013-05-02 17:15:10 -0300
commit4dbe6ac4e8ae91249848777b2127049318107c4c (patch)
treec8d0a098bd3073ee3caeec69c0c0be9386e9274d /src/map/itemdb.c
parenta2c45a8db6d724b98ab41fe9e75e1f7ea7523d5d (diff)
parent58a035a53efcafea1623999832a764fabba1bf5f (diff)
downloadhercules-4dbe6ac4e8ae91249848777b2127049318107c4c.tar.gz
hercules-4dbe6ac4e8ae91249848777b2127049318107c4c.tar.bz2
hercules-4dbe6ac4e8ae91249848777b2127049318107c4c.tar.xz
hercules-4dbe6ac4e8ae91249848777b2127049318107c4c.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r--src/map/itemdb.c26
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();
}