summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--db/item_db.txt2
-rw-r--r--src/map/itemdb.c12
3 files changed, 14 insertions, 2 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index e4d2734d7..3f2200b82 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2008/04/22
+ * Changed itemdb_reload to clear the database before reloading, so it is possible
+ can remove an item from the DB without restarting the server (bugreport:1348) (r12635). [Kevin]
* Fixed a "bug" in sv_readdb under windows and cygwin configured as "Unix/binary" for text
files ('\r' is read and empty lines are not skipped) bugreport:1382 bugreport:1401 [Toms]
2008/04/21
diff --git a/db/item_db.txt b/db/item_db.txt
index 2fd65f1c9..d76e3ad67 100644
--- a/db/item_db.txt
+++ b/db/item_db.txt
@@ -5,7 +5,7 @@
//
// Healing Items
//=============================================================
-501,Red_Potion,Red Potion,0,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(45,65),0; },{},{}
+501,Red_Potion,Red Potion,0,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(45,65),0; },{},{}`
502,Orange_Potion,Orange Potion,0,200,,100,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(105,145),0; },{},{}
503,Yellow_Potion,Yellow Potion,0,550,,130,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(175,235),0; },{},{}
504,White_Potion,White Potion,0,1200,,150,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(325,405),0; },{},{}
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index d8c767dc8..25b47eb64 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -1018,7 +1018,17 @@ static int itemdb_final_sub(DBKey key,void *data,va_list ap)
void itemdb_reload(void)
{
- //Just read, the function takes care of freeing scripts.
+
+ int i;
+
+ for( i = 0; i < ARRAYLENGTH(itemdb_array); ++i )
+ if( itemdb_array[i] )
+ destroy_item_data(itemdb_array[i], 1);
+
+ itemdb_other->clear(itemdb_other, itemdb_final_sub);
+
+ memset(itemdb_array, 0, sizeof(itemdb_array));
+
itemdb_read();
}