From 026678d1828ff886c3d1695dca234b4902c88f9d Mon Sep 17 00:00:00 2001 From: Kyle Sanderson Date: Fri, 6 Sep 2019 10:07:54 -0700 Subject: [PATCH] flip to queue - fix serial on resched. --- core/PlayerManager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index 6f8f2d79..129a1912 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -919,8 +919,7 @@ void PlayerManager::OnPrintfFrameAction(unsigned int serial) int nNumBitsWritten = pNetChan->GetNumBitsWritten(false); // SVC_Print uses unreliable netchan #endif - ke::LinkedList::iterator iter = player.m_PrintfBuffer.begin(); - ke::AString &string = (*iter); + ke::AString &string = player.m_PrintfBuffer.front(); // stop if we'd overflow the SVC_Print buffer (+7 as ceil) if ((nNumBitsWritten + NETMSG_TYPE_BITS + 7) / 8 + string.length() >= SVC_Print_BufferSize) @@ -928,13 +927,13 @@ void PlayerManager::OnPrintfFrameAction(unsigned int serial) SH_CALL(engine, &IVEngineServer::ClientPrintf)(player.m_pEdict, string.chars()); - player.m_PrintfBuffer.erase(iter); + player.m_PrintfBuffer.popFront(); } if (!player.m_PrintfBuffer.empty()) { // continue processing it on the next gameframe as buffer is not empty - g_SourceMod.AddFrameAction(PrintfBuffer_FrameAction, (void *)(intptr_t)client); + g_SourceMod.AddFrameAction(PrintfBuffer_FrameAction, (void *)(uintptr_t)player.GetSerial()); } }