From 0de347d430106ac3bf9df005aedb826076255e44 Mon Sep 17 00:00:00 2001 From: tomangelo2 Date: Wed, 26 Jul 2017 14:54:04 +0200 Subject: [PATCH] Fixed goto() behaviour on 32-bit binaries Closes issue #844 --- src/object/task/taskgoto.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/object/task/taskgoto.cpp b/src/object/task/taskgoto.cpp index 5d6cd4756..6584465e8 100644 --- a/src/object/task/taskgoto.cpp +++ b/src/object/task/taskgoto.cpp @@ -803,7 +803,8 @@ Error CTaskGoto::Start(Math::Vector goal, float altitude, Error CTaskGoto::IsEnded() { Math::Vector pos; - float limit, angle = 0.0f, dist, h, level; + float limit, angle = 0.0f, h, level; + volatile float dist; //fix for issue #844 if ( m_engine->GetPause() ) return ERR_CONTINUE; if ( m_error != ERR_OK ) return m_error; @@ -916,7 +917,9 @@ Error CTaskGoto::IsEnded() if ( m_goalMode == TGG_EXPRESS ) { dist = Math::DistanceProjected(m_goal, pos); - if ( dist < 10.0f && dist > m_lastDistance ) + float margin = 10.0f; + if ( m_object->Implements(ObjectInterfaceType::Flying) ) margin = 20.0f; + if ( dist < margin && dist > m_lastDistance ) { return ERR_STOP; }