From 5deaeaaf82f76506fc4df29b1fef772eaa8a1675 Mon Sep 17 00:00:00 2001
From: Joseph Walton-Rivers <joseph@walton-rivers.uk>
Date: Sun, 4 Sep 2022 17:54:29 +0100
Subject: [PATCH] ensure that dynamics are present with using null physics to
 avoid crash

---
 include/fggl/phys/null.hpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/fggl/phys/null.hpp b/include/fggl/phys/null.hpp
index 2cc7dfa..79c296e 100644
--- a/include/fggl/phys/null.hpp
+++ b/include/fggl/phys/null.hpp
@@ -25,8 +25,11 @@
 namespace fggl::phys {
 
 	inline void build_noop(const entity::ComponentSpec & /*config*/,
-						   entity::EntityManager & /*manager*/,
-						   const entity::EntityID & /*entity*/) {}
+						   entity::EntityManager & manager,
+						   const entity::EntityID & entity) {
+		manager.add<fggl::phys::RigidBody>(entity);
+		manager.add<fggl::phys::Dynamics>(entity);
+	}
 
 	class NullPhysicsEngine : public PhysicsEngine {
 		public:
-- 
GitLab