CGameClient: Move Predict() implementation to .cpp file and reformat it

This commit is contained in:
Alexander Akulich 2023-08-26 20:12:38 +03:00
parent 6555799e85
commit 63ed421e38
2 changed files with 20 additions and 1 deletions

View file

@ -750,6 +750,25 @@ int CGameClient::GetLastRaceTick()
return m_Ghost.GetLastRaceTick();
}
bool CGameClient::Predict() const
{
if(!g_Config.m_ClPredict)
return false;
if(m_Snap.m_pGameInfoObj)
{
if(m_Snap.m_pGameInfoObj->m_GameStateFlags & GAMESTATEFLAG_GAMEOVER)
{
return false;
}
}
if(Client()->State() == IClient::STATE_DEMOPLAYBACK)
return false;
return !m_Snap.m_SpecInfo.m_Active && m_Snap.m_pLocalCharacter;
}
void CGameClient::OnRelease()
{
// release all systems

View file

@ -527,7 +527,7 @@ public:
bool AntiPingGrenade() { return g_Config.m_ClAntiPing && g_Config.m_ClAntiPingGrenade && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK; }
bool AntiPingWeapons() { return g_Config.m_ClAntiPing && g_Config.m_ClAntiPingWeapons && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK; }
bool AntiPingGunfire() { return AntiPingGrenade() && AntiPingWeapons() && g_Config.m_ClAntiPingGunfire; }
bool Predict() { return g_Config.m_ClPredict && !(m_Snap.m_pGameInfoObj && m_Snap.m_pGameInfoObj->m_GameStateFlags & GAMESTATEFLAG_GAMEOVER) && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK && m_Snap.m_pLocalCharacter; }
bool Predict() const;
bool PredictDummy() { return g_Config.m_ClPredictDummy && Client()->DummyConnected() && m_Snap.m_LocalClientID >= 0 && m_PredictedDummyID >= 0 && !m_aClients[m_PredictedDummyID].m_Paused; }
const CTuningParams *GetTuning(int i) { return &m_aTuningList[i]; }