From 3eefa68534383749afe5a630cfa6190c00a82525 Mon Sep 17 00:00:00 2001 From: Tater Date: Sun, 2 Jun 2024 19:41:26 -0500 Subject: [PATCH] Don't let old inputs overwrite current tick input --- src/engine/server/server.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index dea15951663..1404c1d152c 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -1666,6 +1666,12 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket) if(IntendedTick <= Tick()) IntendedTick = Tick() + 1; + // Check once again that we are not overriding an input the client has already sent + // This is a workaround while the above code is still able to change IntendedTick + BufferPosition = IntendedTick % 200; + if(m_aClients[ClientId].m_aInputs[BufferPosition].m_GameTick == IntendedTick) + return; + CClient::CInput *pInput = &m_aClients[ClientId].m_aInputs[BufferPosition]; pInput->m_GameTick = IntendedTick;