diff --git a/sources/Runner/GameScene.cpp b/sources/Runner/GameScene.cpp index 4a427712..187d4d7e 100644 --- a/sources/Runner/GameScene.cpp +++ b/sources/Runner/GameScene.cpp @@ -82,6 +82,9 @@ namespace BBM .addComponent(1, [](WAL::Entity &entity, WAL::Wal &) { auto &animation = entity.getComponent(); animation.setAnimIndex(5); + + if (entity.hasComponent()) + entity.removeComponent(); if (entity.hasComponent()) return; entity.addComponent(1s, [](WAL::Entity &entity, WAL::Wal &wal) { diff --git a/sources/System/Controllable/ControllableSystem.cpp b/sources/System/Controllable/ControllableSystem.cpp index aeeb40d5..36e9815a 100644 --- a/sources/System/Controllable/ControllableSystem.cpp +++ b/sources/System/Controllable/ControllableSystem.cpp @@ -22,7 +22,7 @@ namespace BBM auto health = entity->tryGetComponent(); Vector2f move = controllable.move.normalized() * controllable.speed; - if (health->getHealthPoint() <= 0) + if (health && health->getHealthPoint() <= 0) return; movable.addForce(Vector3f(move.x, 0, move.y)); }