From 31840066c4795124a887cd12996cf7dc13fcef25 Mon Sep 17 00:00:00 2001 From: codemaster Date: Sun, 9 Jan 2005 23:34:57 +0000 Subject: * Added 'OnInterIfInitOnce' for WoE scripts & modified the WoE scripts as well [Ajarn & Codemaster] [Thanks to FREYA] [SVN 943] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@943 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/chrif.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/map/chrif.c') diff --git a/src/map/chrif.c b/src/map/chrif.c index c04630300..f7e6781d6 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -36,13 +36,14 @@ static const int packet_len_table[0x20] = { -1,-1,10, 6,11,-1, 0, 0, // 2b10-2b17 }; -int char_fd; +int char_fd = -1; int srvinfo; static char char_ip_str[16]; static int char_ip; static int char_port = 6121; static char userid[24], passwd[24]; -static int chrif_state; +static int chrif_state = 0; +static int char_init_done = 0; // 設定ファイル読み込み関係 /*========================================== @@ -256,6 +257,11 @@ int chrif_connectack(int fd) ShowStatus(tmp_output); sprintf(tmp_output,"Event '"CL_WHITE"OnInterIfInit"CL_RESET"' executed with '"CL_WHITE"%d"CL_RESET"' NPCs.\n", npc_event_doall("OnInterIfInit")); ShowStatus(tmp_output); + if(!char_init_done) { + char_init_done = 1; + sprintf(tmp_output,"Event '"CL_WHITE"OnInterIfInitOnce"CL_RESET"' executed with '"CL_WHITE"%d"CL_RESET"' NPCs.\n", npc_event_doall("OnInterIfInitOnce")); + ShowStatus(tmp_output); + } // Run Event [AgitInit] // printf("NPC_Event:[OnAgitInit] do (%d) events (Agit Initialize).\n", npc_event_doall("OnAgitInit")); -- cgit v1.2.3-70-g09d2