Skip to content

Commit

Permalink
Fixed goto() behaviour on 32-bit binaries
Browse files Browse the repository at this point in the history
Closes issue colobot#844
  • Loading branch information
tomangelo2 committed Jul 26, 2017
1 parent 75d9f85 commit 0de347d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/object/task/taskgoto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 0de347d

Please sign in to comment.