Skip to content

Commit

Permalink
Don't let old inputs overwrite current tick input
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrc6 committed Jun 3, 2024
1 parent a202751 commit 3eefa68
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/engine/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 3eefa68

Please sign in to comment.