Browse Source

Follow up r16403, adjusted map_reloadnpcs to follow new config standards(r16382).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16404 54d463be-8e91-2dee-dedb-b68131a5f0ec
greenboxal2 13 năm trước cách đây
mục cha
commit
4ad7e62105
3 tập tin đã thay đổi với 13 bổ sung10 xóa
  1. 1 1
      src/map/atcommand.c
  2. 11 8
      src/map/map.c
  3. 1 1
      src/map/map.h

+ 1 - 1
src/map/atcommand.c

@@ -3949,7 +3949,7 @@ ACMD_FUNC(reloadscript)
 	//atcommand_broadcast( fd, sd, "@broadcast", "You will feel a bit of lag at this point !" );
 
 	flush_fifos();
-	map_reloadnpc(); // reload config files seeking for npcs
+	map_reloadnpc(true); // reload config files seeking for npcs
 	script_reload();
 	npc_reload();
 

+ 11 - 8
src/map/map.c

@@ -3378,10 +3378,16 @@ void map_reloadnpc_sub(char *cfgName)
 	fclose(fp);
 }
 
-void map_reloadnpc()
+void map_reloadnpc(bool clear)
 {
-	npc_addsrcfile("clear"); // this will clear the current script list
-	map_reloadnpc_sub(MAP_CONF_NAME);
+	if (clear)
+		npc_addsrcfile("clear"); // this will clear the current script list
+
+#ifdef RENEWAL
+	map_reloadnpc_sub("npc/re/scripts_main.conf");
+#else
+	map_reloadnpc_sub("npc/pre-re/scripts_main.conf");
+#endif
 }
 
 int inter_config_read(char *cfgName)
@@ -3888,11 +3894,8 @@ int do_init(int argc, char *argv[])
 	map_config_read(MAP_CONF_NAME);
 	/* only temporary until sirius's datapack patch is complete  */
 	
-#ifdef RENEWAL
-	map_config_read("npc/re/scripts_main.conf");
-#else
-	map_config_read("npc/pre-re/scripts_main.conf");
-#endif
+	// loads npcs
+	map_reloadnpc(false);
 
 	chrif_checkdefaultlogin();
 

+ 1 - 1
src/map/map.h

@@ -682,7 +682,7 @@ struct mob_data * map_getmob_boss(int m);
 struct mob_data * map_id2boss(int id);
 
 // reload config file looking only for npcs
-void map_reloadnpc();
+void map_reloadnpc(bool clear);
 
 /// Bitfield of flags for the iterator.
 enum e_mapitflags