Skip to content

Commit

Permalink
fix rare stuttering issue on low prediction
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrc6 committed Sep 30, 2024
1 parent d9c8a5f commit 1f87cbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/game/client/components/controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,10 @@ bool CControls::CheckNewInput()
TestInput.m_TargetY *= m_pClient->m_Camera.m_Zoom;
}

m_FastInput = TestInput;

if (NewInput)
{
m_FastInput = TestInput;
return true;
}
return false;
Expand Down
8 changes: 4 additions & 4 deletions src/game/client/gameclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,11 @@ void CGameClient::OnInit()

if(GIT_SHORTREV_HASH)
{
str_format(m_aDDNetVersionStr, sizeof(m_aDDNetVersionStr), "%s %s (%s)", GAME_NAME, GAME_RELEASE_VERSION, GIT_SHORTREV_HASH);
str_format(m_aDDNetVersionStr, sizeof(m_aDDNetVersionStr), "%s %s (%s)", CLIENT_NAME, GAME_RELEASE_VERSION, GIT_SHORTREV_HASH);
}
else
{
str_format(m_aDDNetVersionStr, sizeof(m_aDDNetVersionStr), "%s %s", GAME_NAME, GAME_RELEASE_VERSION);
str_format(m_aDDNetVersionStr, sizeof(m_aDDNetVersionStr), "%s %s", CLIENT_NAME, GAME_RELEASE_VERSION);
}

// set the language
Expand Down Expand Up @@ -2209,7 +2209,7 @@ void CGameClient::OnPredict()
m_PrevPredictedWorld.CopyWorld(&m_PredictedWorld);
m_PredictedPrevChar = pLocalChar->GetCore();
}
if(Tick == FinalTick - (1 - g_Config.m_ClFastInputOthers))
if(Tick == FinalTick - std::max(g_Config.m_ClFastInput - g_Config.m_ClFastInputOthers, 0))
{
for(int i = 0; i < MAX_CLIENTS; i++)
if(CCharacter *pChar = m_PredictedWorld.GetCharacterById(i))
Expand Down Expand Up @@ -2246,7 +2246,7 @@ void CGameClient::OnPredict()
{
m_PredictedChar = pLocalChar->GetCore();
}
if (Tick == FinalTick - (1 - g_Config.m_ClFastInputOthers))
if(Tick == FinalTick - std::max(g_Config.m_ClFastInput - g_Config.m_ClFastInputOthers, 0))
{
for(int i = 0; i < MAX_CLIENTS; i++)
if(CCharacter *pChar = m_PredictedWorld.GetCharacterById(i))
Expand Down

0 comments on commit 1f87cbe

Please sign in to comment.