mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #203 from trml/predict_player_collision
(antiping) improve prediction of collision between players
This commit is contained in:
commit
a1049267c3
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue