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)

This commit is contained in:
Pavol Marko 2005-02-07 10:28:22 +00:00
parent a2c2dc88fc
commit 26e8b0dbb6

View File

@ -422,10 +422,11 @@ 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);
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->ingame) {
if (pPlayer->initialized)
executeForwards(FF_ClientDisconnect, pPlayer->index);
if (pPlayer->ingame) {
--g_players_num;
}
pPlayer->Disconnect();