Merge pull request #203 from trml/predict_player_collision

(antiping) improve prediction of collision between players
This commit is contained in:
Dennis Felsing 2015-05-04 17:46:14 +02:00
commit a1049267c3

View file

@ -1568,13 +1568,36 @@ void CGameClient::OnPredict()
}
// move all players and quantize their data
if(g_Config.m_ClAntiPingPlayers)
{
for(int h = 0; h < 3; h++)
{
if(h == 1)
{
if(World.m_apCharacters[m_Snap.m_LocalClientID])
{
World.m_apCharacters[m_Snap.m_LocalClientID]->Move();
World.m_apCharacters[m_Snap.m_LocalClientID]->Quantize();
}
}
else
for(int c = 0; c < MAX_CLIENTS; c++)
if(c != m_Snap.m_LocalClientID && World.m_apCharacters[c] && ((h == 0 && IsWeaker[g_Config.m_ClDummy][c]) || (h == 2 && !IsWeaker[g_Config.m_ClDummy][c])))
{
World.m_apCharacters[c]->Move();
World.m_apCharacters[c]->Quantize();
}
}
}
else
{
for(int c = 0; c < MAX_CLIENTS; c++)
{
if(!World.m_apCharacters[c])
continue;
World.m_apCharacters[c]->Move();
World.m_apCharacters[c]->Quantize();
}
}
// check if we want to trigger effects