From e8524f706aa516778e6e5e926edff2a839989ed8 Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Tue, 27 Nov 2007 07:12:30 +0000 Subject: * Fixed fake_nd not being exported correctly and being unloaded when reloading scripts. (probably fixes bugreport:444) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11816 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/npc.c | 5 ++++- src/map/npc.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/map') diff --git a/src/map/npc.c b/src/map/npc.c index a65cf5e83..12d8f0e9b 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -33,6 +33,8 @@ #include +struct npc_data* fake_nd; + // linked list of npc source files struct npc_src_list { struct npc_src_list* next; @@ -2783,7 +2785,8 @@ static int npc_cleanup_dbsub(DBKey key, void* data, va_list ap) switch(bl->type) { case BL_NPC: - npc_unload((struct npc_data *)bl); + if( bl->id != fake_nd->bl.id )// don't remove fake_nd + npc_unload((struct npc_data *)bl); break; case BL_MOB: unit_free(bl,0); diff --git a/src/map/npc.h b/src/map/npc.h index c1a7dbfe9..2d203fdb5 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -90,6 +90,6 @@ int npc_reload(void); void npc_read_event_script(void); int npc_script_event(struct map_session_data* sd, int type); -struct npc_data *fake_nd; +extern struct npc_data* fake_nd; #endif /* _NPC_H_ */ -- cgit v1.2.3-70-g09d2