Skip to content

Commit

Permalink
Fix setinterval
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Dec 3, 2018
1 parent c59523b commit dc0337a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/Actor.cpp
Expand Up @@ -980,15 +980,12 @@ Actor::UpdateInternal(float delta_time)
}
LUA->Release(L);
delayedPeriodicFunctionIdsToDelete.clear();
for (auto it = this->delayedPeriodicFunctions.begin();
it != this->delayedPeriodicFunctions.end();
++it) {
auto& delayedF = *it;
std::get<1>(delayedF) -= delta_time;
if (std::get<1>(delayedF) <= 0) {
std::get<0>(delayedF)();
std::get<1>(delayedF) = std::get<2>(delayedF);
}
}
for (auto& delayedF : delayedPeriodicFunctions) {
std::get<1>(delayedF) -= delta_time;
if (std::get<1>(delayedF) <= 0) {
std::get<0>(delayedF)();
std::get<1>(delayedF) = std::get<2>(delayedF);
}
}
}
Expand Down

0 comments on commit dc0337a

Please sign in to comment.