From 63d6d8479b0888298d188f6e7e32bd5078b5adaf Mon Sep 17 00:00:00 2001 From: "arthur.jamet" Date: Thu, 3 Jun 2021 12:33:57 +0200 Subject: [PATCH] fix merge --- .gitignore | 2 +- sources/System/Animation/AnimationsSystem.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 74044c49..7c2238fc 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,5 @@ cmake-build-debug .vscode build/* docs/* -emsdk/* +emsdk/ build_web/* \ No newline at end of file diff --git a/sources/System/Animation/AnimationsSystem.cpp b/sources/System/Animation/AnimationsSystem.cpp index 3400cf10..cce35719 100644 --- a/sources/System/Animation/AnimationsSystem.cpp +++ b/sources/System/Animation/AnimationsSystem.cpp @@ -13,7 +13,7 @@ namespace BBM AnimationsSystem::AnimationsSystem() : WAL::System({ - typeid(Drawable3DComponent), + typeid(Drawable3DComponent), typeid(AnimationsComponent) }) { @@ -21,12 +21,15 @@ namespace BBM void AnimationsSystem::onUpdate(WAL::Entity &entity, std::chrono::nanoseconds) { - auto &model = entity.getComponent>(); + auto &model = entity.getComponent(); auto &anim = entity.getComponent(); if (anim.isDisabled()) return; - model.member.setAnimation(anim.getCurrentModelAnim()); - anim.incCurrentAnimFrameCounter(); + auto modelPtr = std::dynamic_pointer_cast(model.drawable); + if (modelPtr) { + modelPtr->setAnimation(anim.getCurrentModelAnim()); + anim.incCurrentAnimFrameCounter(); + } } } \ No newline at end of file