From 26e8b0dbb657463ec3ea6d96ffaa0b798bb68a26 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Mon, 7 Feb 2005 10:28:22 +0000 Subject: [PATCH] client_disconnect forwards now get called for every client which is initialized (ie. client_connect was called for him) instead of clients which are ingame only (ie. client_putinserver was called) --- amxmodx/meta_api.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/amxmodx/meta_api.cpp b/amxmodx/meta_api.cpp index 50777446..ea5355e4 100755 --- a/amxmodx/meta_api.cpp +++ b/amxmodx/meta_api.cpp @@ -422,9 +422,10 @@ void C_ServerDeactivate() { for(int i = 1; i <= gpGlobals->maxClients; ++i){ CPlayer *pPlayer = GET_PLAYER_POINTER_I(i); - if (pPlayer->ingame){ + if (pPlayer->initialized) + executeForwards(FF_ClientDisconnect, pPlayer->index); - executeForwards(FF_ClientDisconnect, pPlayer->index); + if (pPlayer->ingame){ pPlayer->Disconnect(); --g_players_num; @@ -546,8 +547,10 @@ BOOL C_ClientConnect_Post( edict_t *pEntity, const char *pszName, const char *ps void C_ClientDisconnect( edict_t *pEntity ) { CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity); + if (pPlayer->initialized) + executeForwards(FF_ClientDisconnect, pPlayer->index); + if (pPlayer->ingame) { - executeForwards(FF_ClientDisconnect, pPlayer->index); --g_players_num; } pPlayer->Disconnect();