aboutsummaryrefslogtreecommitdiffstats
path: root/src/script.cpp
diff options
context:
space:
mode:
authorAndy Belle-Isle <drumsetmonkey@gmail.com>2019-09-03 02:22:39 -0400
committerAndy Belle-Isle <drumsetmonkey@gmail.com>2019-09-03 02:22:39 -0400
commit9c9f72c29a71a1813e9bc42d57998676237b57e3 (patch)
tree248f042a14b3f889cf0eb616d2776fd1fb514450 /src/script.cpp
parentaa7b0a92d065b4435467d482ec65dd97b03459ee (diff)
Start working on Lua function serialization
Diffstat (limited to 'src/script.cpp')
-rw-r--r--src/script.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/script.cpp b/src/script.cpp
index fa485bc..351aae4 100644
--- a/src/script.cpp
+++ b/src/script.cpp
@@ -57,7 +57,7 @@ void ScriptSystem::receive([[maybe_unused]] const EntitySpawnEvent &toSpawn)
int ScriptSystem::init(void)
{
- lua.open_libraries(sol::lib::base, sol::lib::math);
+ lua.open_libraries(sol::lib::base, sol::lib::math, sol::lib::string);
scriptExport();
doFile();
@@ -176,6 +176,8 @@ sol::table ScriptSystem::spawn(sol::object param)
}
if (tab["Light"] != nullptr) {
+ if (!e.has_component<Position>()) // Position must exist for vel.
+ (*toRet)["Position"] = e.assign<Position>().get();
(*toRet)["Light"] =
e.assign<Light>(Light().FromLua(tab["Light"])).get();
}