Fixed manual control overriding tasks
parent
78a51f0acb
commit
a754b2ad06
|
@ -35,6 +35,8 @@
|
|||
#include "object/motion/motion.h"
|
||||
#include "object/motion/motionvehicle.h"
|
||||
|
||||
#include "object/task/taskmanager.h"
|
||||
|
||||
#include "physics/physics.h"
|
||||
|
||||
#include "script/script.h"
|
||||
|
@ -189,6 +191,12 @@ bool CBrain::EventProcess(const Event &event)
|
|||
|
||||
if ( !m_object->GetSelect() ) return true; // robot not selected?
|
||||
|
||||
if ( m_taskExecutor->IsForegroundTask() || // current task?
|
||||
m_currentProgram != nullptr )
|
||||
{
|
||||
if ( !m_taskExecutor->IsForegroundTask() || !m_taskExecutor->GetForegroundTask()->IsPilot() ) return true;
|
||||
}
|
||||
|
||||
if ( event.type == EVENT_OBJECT_LEFT ||
|
||||
event.type == EVENT_OBJECT_RIGHT ||
|
||||
event.type == EVENT_OBJECT_UP ||
|
||||
|
|
|
@ -288,10 +288,7 @@ bool CObjectInterface::EventProcess(const Event &event)
|
|||
return true;
|
||||
}
|
||||
|
||||
if ( !m_object->GetSelect() ) // robot not selected?
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ( !m_object->GetSelect() ) return true; // robot not selected?
|
||||
|
||||
if ( m_taskExecutor->IsBackgroundTask() ) // current task?
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue