mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
CGameClient: Move Predict() implementation to .cpp file and reformat it
This commit is contained in:
parent
6555799e85
commit
63ed421e38
|
@ -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
|
||||
|
|
|
@ -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]; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue