Fix dt in behavior_tree::updater
This commit is contained in:
parent
6e4db713d3
commit
73bf540967
1 changed files with 6 additions and 3 deletions
|
|
@ -111,8 +111,8 @@ namespace psemek::util
|
|||
|
||||
update_statistics update(Time dt)
|
||||
{
|
||||
activate();
|
||||
fill_dt(dt);
|
||||
activate();
|
||||
wake_up(dt);
|
||||
|
||||
update_statistics result;
|
||||
|
|
@ -139,6 +139,7 @@ namespace psemek::util
|
|||
{
|
||||
for (auto & n : new_)
|
||||
{
|
||||
n.elapsed = 0;
|
||||
std::apply([&](Args ... args){ n.node.start(args...); }, n.args);
|
||||
active_.push_back(std::move(n));
|
||||
}
|
||||
|
|
@ -195,9 +196,9 @@ namespace psemek::util
|
|||
void start(Args ...)
|
||||
{}
|
||||
|
||||
status update(Time, Args ... args)
|
||||
status update(Time dt, Args ... args)
|
||||
{
|
||||
actionFn(args...);
|
||||
actionFn(dt, args...);
|
||||
return finished{true};
|
||||
}
|
||||
|
||||
|
|
@ -444,6 +445,7 @@ namespace psemek::util
|
|||
current_started = true;
|
||||
}
|
||||
auto result = std::get<I>(children).update(dt, args...);
|
||||
dt = 0;
|
||||
if (auto f = std::get_if<finished>(&result))
|
||||
{
|
||||
if (f->result)
|
||||
|
|
@ -535,6 +537,7 @@ namespace psemek::util
|
|||
current_started = true;
|
||||
}
|
||||
auto result = std::get<I>(children).update(dt, args...);
|
||||
dt = 0;
|
||||
if (auto f = std::get_if<finished>(&result))
|
||||
{
|
||||
if (!(f->result))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue