Skip to content

Commit

Permalink
Flush events before stepping the state machine instance (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhonnyg authored Nov 15, 2024
1 parent 2fb3018 commit 45a4813
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions defold-rive/src/comp_rive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,15 +786,15 @@ namespace dmRive

if (component.m_StateMachineInstance)
{
component.m_StateMachineInstance->advanceAndApply(dt * component.m_AnimationPlaybackRate);

size_t event_count = component.m_StateMachineInstance->reportedEventCount();
for (size_t i = 0; i < event_count; i++)
{
rive::EventReport reported_event = component.m_StateMachineInstance->reportedEventAt(i);
rive::Event* event = reported_event.event();
CompRiveEventTriggerCallback(&component, event);
}

component.m_StateMachineInstance->advanceAndApply(dt * component.m_AnimationPlaybackRate);
}
else if (component.m_AnimationInstance)
{
Expand Down

0 comments on commit 45a4813

Please sign in to comment.