Skip to content

Commit

Permalink
Refactor to keep internal behavior instead of any external one
Browse files Browse the repository at this point in the history
  • Loading branch information
YannLocatelli committed Dec 18, 2023
1 parent 058a82a commit 7824b5f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libs/BehaviorKit/source/BehaviorKit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ void BehaviorKit::start(interface::Behavior *behavior)
{
stop();

_behavior = behavior;

if (_behavior == nullptr) {
if (behavior == nullptr) {
return;
}
_behavior = *std::find(std::begin(_behaviors), std::end(_behaviors), behavior); // TODO: can't be null

_event_loop.start();
if (_timeout_duration != std::chrono::seconds {0}) {
Expand Down

0 comments on commit 7824b5f

Please sign in to comment.