From a531c64908deb1fe407462e88fa7427230e6b254 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Fri, 24 Aug 2012 15:07:19 +0000 Subject: 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 --- src/map/npc.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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) { -- cgit v1.2.3-70-g09d2