aboutsummaryrefslogtreecommitdiffstats
path: root/src/script.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script.cpp')
-rw-r--r--src/script.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/script.cpp b/src/script.cpp
index 351aae4..d8f23ec 100644
--- a/src/script.cpp
+++ b/src/script.cpp
@@ -78,6 +78,7 @@ void ScriptSystem::doFile(void)
/********************
* SCRIPT PARSING *
********************/
+#include <components/EventListener.hpp>
#include <components/Position.hpp>
#include <components/Player.hpp>
#include <components/Name.hpp>
@@ -182,6 +183,12 @@ sol::table ScriptSystem::spawn(sol::object param)
e.assign<Light>(Light().FromLua(tab["Light"])).get();
}
+ // Probably should be last
+ if (tab["EventListeners"] != nullptr) {
+ sol::table listeners = tab["EventListeners"];
+ e.assign<EventListener>(listeners);
+ }
+
} else {
// TODO better logging
std::cerr << "Parameter to spawn() must be a table!" << std::endl;