diff --git a/Core/GameEngine/Source/Common/System/Radar.cpp b/Core/GameEngine/Source/Common/System/Radar.cpp index fb550078f64..7a9ded4731e 100644 --- a/Core/GameEngine/Source/Common/System/Radar.cpp +++ b/Core/GameEngine/Source/Common/System/Radar.cpp @@ -1186,8 +1186,7 @@ Bool Radar::tryEvent( RadarEventType event, const Coord3D *pos ) { // get distance from our new event location to this event location in 2D - Real distSquared = m_event[ i ].worldLoc.x - pos->x * m_event[ i ].worldLoc.x - pos->x + - m_event[ i ].worldLoc.y - pos->y * m_event[ i ].worldLoc.y - pos->y; + const Real distSquared = sqr(m_event[ i ].worldLoc.x - pos->x) + sqr(m_event[ i ].worldLoc.y - pos->y); if( distSquared <= closeEnoughDistanceSq ) {