summaryrefslogtreecommitdiff
path: root/src/map/itemdb.c
diff options
context:
space:
mode:
authorKevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-22 22:02:54 +0000
committerKevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-22 22:02:54 +0000
commit69a6aa49d228a03b45631d96d9c965b58f89ab20 (patch)
tree4fcc7b54edcad73f10bca7cf7c2142abc0cf4fdb /src/map/itemdb.c
parent3637b1367f245b7125c002f1dbe6a5da1b9143e7 (diff)
downloadhercules-69a6aa49d228a03b45631d96d9c965b58f89ab20.tar.gz
hercules-69a6aa49d228a03b45631d96d9c965b58f89ab20.tar.bz2
hercules-69a6aa49d228a03b45631d96d9c965b58f89ab20.tar.xz
hercules-69a6aa49d228a03b45631d96d9c965b58f89ab20.zip
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)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12635 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r--src/map/itemdb.c12
1 files changed, 11 insertions, 1 deletions
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();
}