Skip to content

Commit

Permalink
Fix animation callback
Browse files Browse the repository at this point in the history
  • Loading branch information
edunad committed May 9, 2024
1 parent f94b717 commit 76b2817
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rawrbox.render/include/rawrbox/render/models/model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ namespace rawrbox {
this->onAnimationComplete(it->second.name);

if (!it->second.loop) {
if (it->second.onComplete != nullptr) it->second.onComplete();
auto onCompleteCallback = it->second.onComplete;
it = this->_playingAnimations.erase(it);

if (onCompleteCallback != nullptr) onCompleteCallback();
continue;
}
}
Expand Down

0 comments on commit 76b2817

Please sign in to comment.