CEntity: Make NetworkClipped() const

This commit is contained in:
Alexander Akulich 2021-12-08 20:02:04 +03:00
parent cad00f7ce1
commit 57e16f3f7b
2 changed files with 8 additions and 8 deletions

View file

@ -29,14 +29,14 @@ CEntity::~CEntity()
Server()->SnapFreeID(m_ID);
}
bool CEntity::NetworkClipped(int SnappingClient)
bool CEntity::NetworkClipped(int SnappingClient) const
{
return ::NetworkClipped(GameServer(), SnappingClient, m_Pos);
return ::NetworkClipped(m_pGameWorld->GameServer(), SnappingClient, m_Pos);
}
bool CEntity::NetworkClipped(int SnappingClient, vec2 CheckPos)
bool CEntity::NetworkClipped(int SnappingClient, vec2 CheckPos) const
{
return ::NetworkClipped(GameServer(), SnappingClient, CheckPos);
return ::NetworkClipped(m_pGameWorld->GameServer(), SnappingClient, CheckPos);
}
bool CEntity::GameLayerClipped(vec2 CheckPos)
@ -86,7 +86,7 @@ bool CEntity::GetNearestAirPosPlayer(vec2 PlayerPos, vec2 *OutPos)
return false;
}
bool NetworkClipped(CGameContext *pGameServer, int SnappingClient, vec2 CheckPos)
bool NetworkClipped(const CGameContext *pGameServer, int SnappingClient, vec2 CheckPos)
{
if(SnappingClient == -1 || pGameServer->m_apPlayers[SnappingClient]->m_ShowAll)
return false;

View file

@ -128,8 +128,8 @@ public:
Returns:
True if the entity doesn't have to be in the snapshot.
*/
bool NetworkClipped(int SnappingClient);
bool NetworkClipped(int SnappingClient, vec2 CheckPos);
bool NetworkClipped(int SnappingClient) const;
bool NetworkClipped(int SnappingClient, vec2 CheckPos) const;
bool GameLayerClipped(vec2 CheckPos);
@ -142,6 +142,6 @@ public:
int m_Layer;
};
bool NetworkClipped(CGameContext *pGameServer, int SnappingClient, vec2 CheckPos);
bool NetworkClipped(const CGameContext *pGameServer, int SnappingClient, vec2 CheckPos);
#endif