From e2b252b7140a25c277bb5a231e44fc30ab7604db Mon Sep 17 00:00:00 2001 From: fokkonaut <35420825+fokkonaut@users.noreply.github.com> Date: Sat, 4 Jan 2020 16:32:51 +0100 Subject: [PATCH] Distance can't be negative --- src/game/gamecore.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/game/gamecore.cpp b/src/game/gamecore.cpp index 7fb7032bb..374e3933d 100644 --- a/src/game/gamecore.cpp +++ b/src/game/gamecore.cpp @@ -494,15 +494,7 @@ void CCharacterCore::Move() if((!(pCharCore->m_Super || m_Super) && (m_Solo || pCharCore->m_Solo || !pCharCore->m_Collision || pCharCore->m_NoCollision || (m_Id != -1 && !m_pTeams->CanCollide(m_Id, p))))) continue; float D = distance(Pos, pCharCore->m_Pos); - if(D < 28.0f && D > 0.0f) - { - if(a > 0.0f) - m_Pos = LastPos; - else if(distance(NewPos, pCharCore->m_Pos) > D) - m_Pos = NewPos; - return; - } - else if(D <= 0.001f && D >= -0.001f) + if((D < 28.0f && D > 0.0f) || (D <= 0.001f && D >= 0.f)) { if(a > 0.0f) m_Pos = LastPos;