From b024ad05bfc0b8f5eb1eb663a8d76d470d14594e Mon Sep 17 00:00:00 2001 From: Kyle Sanderson Date: Fri, 6 Sep 2019 10:13:39 -0700 Subject: [PATCH] Update PlayerManager.cpp --- core/PlayerManager.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index 129a1912..93d3e511 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -900,14 +900,14 @@ void PlayerManager::OnPrintfFrameAction(unsigned int serial) CPlayer &player = m_Players[client]; if (!player.IsConnected()) { - player.m_PrintfBuffer.clear(); + player.ClearNetchannelQueue(); return; } INetChannel *pNetChan = static_cast(engine->GetPlayerNetInfo(client)); if (pNetChan == NULL) { - player.m_PrintfBuffer.clear(); + player.ClearNetchannelQueue(); return; } @@ -2236,7 +2236,13 @@ void CPlayer::Disconnect() #if SOURCE_ENGINE == SE_CSGO m_LanguageCookie = InvalidQueryCvarCookie; #endif - m_PrintfBuffer.clear(); + ClearNetchannelQueue(); +} + +void CPlayer::ClearNetchannelQueue(void) +{ + while (!m_PrintfBuffer.empty()) + m_PrintfBuffer.popFront(); } void CPlayer::SetName(const char *name)