MCPcopy Create free account
hub / github.com/ddnet/ddnet / GetNearestAirPosPlayer

Method GetNearestAirPosPlayer

src/game/server/entity.cpp:78–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78bool CEntity::GetNearestAirPosPlayer(vec2 PlayerPos, vec2 *pOutPos)
79{
80 for(int Distance = 5; Distance >= -1; Distance--)
81 {
82 *pOutPos = vec2(PlayerPos.x, PlayerPos.y - Distance);
83 if(!GameServer()->Collision()->TestBox(*pOutPos, CCharacterCore::PhysicalSizeVec2()))
84 {
85 return true;
86 }
87 }
88 return false;
89}
90
91bool NetworkClipped(const CGameContext *pGameServer, int SnappingClient, vec2 CheckPos)
92{

Callers

nothing calls this directly

Calls 2

TestBoxMethod · 0.80
CollisionMethod · 0.45

Tested by

no test coverage detected