mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
parent
bb46b6acbf
commit
033df0da7c
|
@ -35,6 +35,17 @@ int CEntity::NetworkClipped(int SnappingClient)
|
|||
|
||||
int CEntity::NetworkClipped(int SnappingClient, vec2 CheckPos)
|
||||
{
|
||||
if(SnappingClient == -1 || GameServer()->m_apPlayers[SnappingClient]->GetTeam() == TEAM_SPECTATORS || GameServer()->m_apPlayers[SnappingClient]->m_Paused)
|
||||
return 0;
|
||||
|
||||
float dx = GameServer()->m_apPlayers[SnappingClient]->m_ViewPos.x-CheckPos.x;
|
||||
float dy = GameServer()->m_apPlayers[SnappingClient]->m_ViewPos.y-CheckPos.y;
|
||||
|
||||
if(absolute(dx) > 1000.0f || absolute(dy) > 800.0f)
|
||||
return 1;
|
||||
|
||||
if(distance(GameServer()->m_apPlayers[SnappingClient]->m_ViewPos, CheckPos) > 1100.0f)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue