summaryrefslogtreecommitdiff
path: root/src/map/itemdb.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-07-18 05:34:34 -0300
committershennetsind <ind@henn.et>2013-07-18 05:34:34 -0300
commite26c9504e825abe8fe50eca28bf3b89de8e4bd9c (patch)
treecb329c296924f8f8ff47033e90e9b528bb4bd9cf /src/map/itemdb.c
parent586c0f7983f81e97ca70c57712e25d4d51453d6b (diff)
downloadhercules-e26c9504e825abe8fe50eca28bf3b89de8e4bd9c.tar.gz
hercules-e26c9504e825abe8fe50eca28bf3b89de8e4bd9c.tar.bz2
hercules-e26c9504e825abe8fe50eca28bf3b89de8e4bd9c.tar.xz
hercules-e26c9504e825abe8fe50eca28bf3b89de8e4bd9c.zip
Fixed Bug #7525
Item name constants conflicting with script var names will now result in a map server warning/notice and in the background map server will prioritise the script variable over the item name constant. http://hercules.ws/board/tracker/issue-7525-set-variable-is-not-recognized-causing-freezing/ --- Also followup 586c0f7983f81e97ca70c57712e25d4d51453d6b sc_config.txt update Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r--src/map/itemdb.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 3c77c4b14..223c67a3a 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -1942,9 +1942,6 @@ static void itemdb_read(void) {
sv->readdb(iMap->db_path, DBPATH"item_buyingstore.txt", ',', 1, 1, -1, &itemdb_read_buyingstore);
sv->readdb(iMap->db_path, "item_nouse.txt", ',', 3, 3, -1, &itemdb_read_nouse);
-
- itemdb->name_constants();
-
itemdb_uid_load();
}
@@ -2111,6 +2108,16 @@ void itemdb_name_constants(void) {
dbi_destroy(iter);
}
+/* used to clear conflicts during script reload */
+void itemdb_force_name_constants(void) {
+ DBIterator *iter = db_iterator(itemdb->names);
+ struct item_data *data;
+
+ for( data = dbi_first(iter); dbi_exists(iter); data = dbi_next(iter) )
+ script->set_constant_force(data->name,data->nameid,0);
+
+ dbi_destroy(iter);
+}
void do_final_itemdb(void) {
int i;
@@ -2168,6 +2175,7 @@ void itemdb_defaults(void) {
itemdb->final = do_final_itemdb;
itemdb->reload = itemdb_reload;//incomplete
itemdb->name_constants = itemdb_name_constants;
+ itemdb->force_name_constants = itemdb_force_name_constants;
/* */
itemdb->groups = NULL;
itemdb->group_count = 0;