From 5e48cf6333aca7af6854d79194f138d57ce0b5e1 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 14 May 2018 18:40:54 -0400 Subject: Specialized treatment of behavior scripts The AutomatableComponent now links to the Runnable entity representing the behavior script. Also reordered the SystemManager and EntityManager members of the Game class such that the EntityManager is destroyed before the SystemManager is. This fixes a bug where the destruction of a component has some affect on the state of a system. Specifically, if the ScriptingSystem (and thus the Lua state) is destroyed before the EntityManager is and there are any Runnable entities, the game will crash when trying to destroy them. --- src/components/prototypable.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/components/prototypable.h') diff --git a/src/components/prototypable.h b/src/components/prototypable.h index 4659e7c..c0dd972 100644 --- a/src/components/prototypable.h +++ b/src/components/prototypable.h @@ -9,14 +9,15 @@ public: using id_type = EntityManager::id_type; + /** + * The index of the object in the map definition. + */ size_t mapObjectIndex; + /** + * The name of the prototype that the object was spawned from. + */ std::string prototypeId; - - bool hasBehavior = false; - bool runningBehavior = false; - - id_type behaviorScript; }; #endif /* end of include guard: PROTOTYPABLE_H_817F2205 */ -- cgit 1.4.1