From 9c1e45d97c03edfd01a0775351acc0c62decc661 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Fri, 21 Nov 2008 14:09:50 -0600 Subject: [PATCH] Fixed crash when L4D server went into hibernation mode after having had an active bot and a reserved name was used by this bot - When going into hibernation, ClientSettingsChanged is called for remaining bots - Hook checks bot's name against reserved names in admins config and tries to kick using IClient::Disconnect - Method of getting IClient relies on client having an INetChannel pointer - Bots do not have an INetChannel pointer so this results in a crash --- core/PlayerManager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index f5076495..720cadb7 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -699,6 +699,11 @@ void PlayerManager::OnClientSettingsChanged(edict_t *pEntity) m_clinfochanged->PushCell(client); m_clinfochanged->Execute(&res, NULL); + if (pPlayer->IsFakeClient()) + { + return; + } + IPlayerInfo *info = pPlayer->GetPlayerInfo(); const char *new_name = info ? info->GetName() : engine->GetClientConVarValue(client, "name"); const char *old_name = pPlayer->m_Name.c_str();