Add a limit to GetNearestAirPos. Fix #1931

This commit is contained in:
Learath 2019-10-13 16:34:03 +02:00
parent fdf2ec37e7
commit 84f1542f43

View file

@ -57,7 +57,7 @@ bool CEntity::GameLayerClipped(vec2 CheckPos)
bool CEntity::GetNearestAirPos(vec2 Pos, vec2 PrevPos, vec2* pOutPos)
{
while (GameServer()->Collision()->CheckPoint(Pos))
for(int k = 0; k < 16 && GameServer()->Collision()->CheckPoint(Pos); k++)
{
Pos -= normalize(PrevPos - Pos);
}