Found it. I was taking a reference to a function pointer that was on the stack.

This commit is contained in:
Zed A. Shaw 2026-02-13 12:38:25 -05:00
parent 2484802d93
commit 2cef58be69

View file

@ -122,7 +122,7 @@ namespace scene {
void Engine::animate_actor(const std::string& actor) {
auto& config = actor_config(actor);
config.anim.play();
if(!config.anim.playing) config.anim.play();
}
void Engine::play_animations() {
@ -179,7 +179,7 @@ namespace scene {
void Engine::set_end_cb(std::function<void()> cb) {
for(auto& actor : $actors) {
actor.anim.onLoop = [&](auto& seq, auto& tr) -> bool {
actor.anim.onLoop = [=](auto& seq, auto& tr) -> bool {
seq.current = tr.toggled ? seq.frame_count - 1 : 0;
cb();
return tr.looped;