diff --git a/scene.cpp b/scene.cpp index afbd1ca..91a5374 100644 --- a/scene.cpp +++ b/scene.cpp @@ -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 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;