diff --git a/libs/BehaviorKit/source/BehaviorKit.cpp b/libs/BehaviorKit/source/BehaviorKit.cpp index 2ce0984546..f2ce6d269e 100644 --- a/libs/BehaviorKit/source/BehaviorKit.cpp +++ b/libs/BehaviorKit/source/BehaviorKit.cpp @@ -32,22 +32,22 @@ void BehaviorKit::start(interface::Behavior *behavior) void BehaviorKit::start(BehaviorID id) { - // interface::Behavior *found_behavior = nullptr; + interface::Behavior *found_behavior = nullptr; - // for (auto *behavior: _behaviors) { - // if (id == behavior->id()) { - // found_behavior = behavior; - // break; - // } - // } + for (auto *behavior: _behaviors) { + if (id == behavior->id()) { + found_behavior = behavior; + break; + } + } - // start(found_behavior); + start(found_behavior); // ? : ALTERNATIVE - auto predicate = [&id](interface::Behavior *b) { return id == b->id(); }; - auto found_behavior = std::find_if(_behaviors.begin(), _behaviors.end(), predicate); + // auto predicate = [&id](interface::Behavior *b) { return id == b->id(); }; + // auto found_behavior = std::find_if(_behaviors.begin(), _behaviors.end(), predicate); - start(*found_behavior); + // start(*found_behavior); } void BehaviorKit::run()