소스 검색

* Fixed fake_nd not being exported correctly and being unloaded when reloading scripts. (probably fixes bugreport:444)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11816 54d463be-8e91-2dee-dedb-b68131a5f0ec
FlavioJS 17 년 전
부모
커밋
8e58ea8df8
3개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 0
      Changelog-Trunk.txt
  2. 4 1
      src/map/npc.c
  3. 1 1
      src/map/npc.h

+ 3 - 0
Changelog-Trunk.txt

@@ -3,6 +3,9 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+2007/11/27
+	* Fixed fake_nd not being exported correctly and being unloaded when 
+	  reloading scripts. (probably fixes bugreport:444) [FlavioJS]
 2007/11/26
 	* Normalized makefiles:
 	- 3 sections: variables, public targets, private/support targets

+ 4 - 1
src/map/npc.c

@@ -33,6 +33,8 @@
 #include <time.h>
 
 
+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);

+ 1 - 1
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_ */