Browse Source

* Added execution of OnInterIfInit, OnCharIfInit and OnInterIfInitOnce on script reload.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5806 54d463be-8e91-2dee-dedb-b68131a5f0ec
Lance 19 years ago
parent
commit
79a1066e60
3 changed files with 13 additions and 1 deletions
  1. 5 1
      Changelog-Trunk.txt
  2. 2 0
      src/map/intif.h
  3. 6 0
      src/map/npc.c

+ 5 - 1
Changelog-Trunk.txt

@@ -1,7 +1,11 @@
 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. 
+IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+
+2006/03/30
+	* Added execution of OnInterIfInit, OnCharIfInit and OnInterIfInitOnce on script
+	  reload. [Lance] 
 
 2006/03/29
 	* Now none of the pet-menu options will have any effect when the pet's

+ 2 - 0
src/map/intif.h

@@ -58,4 +58,6 @@ int intif_request_petdata(int account_id, int char_id, int pet_id);
 int intif_save_petdata(int account_id, struct s_pet *p);
 int intif_delete_petdata(int pet_id);
 
+int CheckForCharServer(void);
+
 #endif

+ 6 - 0
src/map/npc.c

@@ -2611,6 +2611,12 @@ int npc_reload (void)
 	//Execute the OnInit event for freshly loaded npcs. [Skotlex]
 	ShowStatus("Event '"CL_WHITE"OnInit"CL_RESET"' executed with '"
 	CL_WHITE"%d"CL_RESET"' NPCs.\n",npc_event_doall("OnInit"));
+	// Execute rest of the startup events if connected to char-server. [Lance]
+	if(!CheckForCharServer()){
+		ShowStatus("Event '"CL_WHITE"OnCharIfInit"CL_RESET"' executed with '"CL_WHITE"%d"CL_RESET"' NPCs.\n", npc_event_doall("OnCharIfInit"));
+		ShowStatus("Event '"CL_WHITE"OnInterIfInit"CL_RESET"' executed with '"CL_WHITE"%d"CL_RESET"' NPCs.\n", npc_event_doall("OnInterIfInit"));
+		ShowStatus("Event '"CL_WHITE"OnInterIfInitOnce"CL_RESET"' executed with '"CL_WHITE"%d"CL_RESET"' NPCs.\n", npc_event_doall("OnInterIfInitOnce"));
+	}
 	return 0;
 }