summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-08-24 15:07:19 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-08-24 15:07:19 +0000
commita531c64908deb1fe407462e88fa7427230e6b254 (patch)
tree5c50ee53f6544c67535d7cc314e5c2f008782782 /src/map
parent8d8f130985bc23294cf928a5c872de9298fbff5d (diff)
downloadhercules-a531c64908deb1fe407462e88fa7427230e6b254.tar.gz
hercules-a531c64908deb1fe407462e88fa7427230e6b254.tar.bz2
hercules-a531c64908deb1fe407462e88fa7427230e6b254.tar.xz
hercules-a531c64908deb1fe407462e88fa7427230e6b254.zip
Fixed bugreport:6550 @unloadnpcfile now refreshes the hardcoded npc event array (onpckillevent onpcdieevent etc) so that any unloaded references are properly removed.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16697 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/npc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 97b41e033..b1def4a08 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -3648,12 +3648,16 @@ bool npc_unloadfile( const char* path ) {
for( nd = dbi_first(iter); dbi_exists(iter); nd = dbi_next(iter) ) {
if( nd->path && strcasecmp(nd->path,path) == 0 ) {
found = true;
+ npc_unload_duplicates(nd);/* unload any npcs which could duplicate this but be in a different file */
npc_unload(nd, true);
}
}
dbi_destroy(iter);
+ if( found ) /* refresh event cache */
+ npc_read_event_script();
+
return found;
}
void do_clear_npc(void) {