Skip to content

Commit

Permalink
Fixed animation not starting actions
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardodoria committed Jul 20, 2023
1 parent d4151c8 commit 9a30813
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions engine/core/subsystem/ActionSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,13 @@ void ActionSystem::animationUpdate(double dt, Entity entity, ActionComponent& ac

if (timeDiff >= 0) {
//TODO: Support loop actions
if (timeDiff <= duration) {
ActionComponent& iaction = scene->getComponent<ActionComponent>(animcomp.actions[i].action);
if (iaction.state != ActionState::Running) {
actionStart(animcomp.actions[i].action);
}
iaction.speed = action.speed;
iaction.timecount = timeDiff * action.speed;
}else{
ActionComponent& iaction = scene->getComponent<ActionComponent>(animcomp.actions[i].action);
if (iaction.state != ActionState::Running) {
actionStart(animcomp.actions[i].action);
}
iaction.speed = action.speed;
iaction.timecount = timeDiff * action.speed;
if (timeDiff > duration) {
totalActionsPassed++;
}
}
Expand Down

0 comments on commit 9a30813

Please sign in to comment.