Fixed manual control overriding tasks

master
krzys-h 2015-08-10 17:02:31 +02:00
parent 78a51f0acb
commit a754b2ad06
2 changed files with 9 additions and 4 deletions

View File

@ -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 ||

View File

@ -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?
{