aboutsummaryrefslogtreecommitdiffstats
path: root/src/script.cpp
diff options
context:
space:
mode:
authorclyne <clyne@bitgloo.com>2019-09-03 18:17:51 -0400
committerGitHub <noreply@github.com>2019-09-03 18:17:51 -0400
commitec1d57aeadbd0f34616eeec8f1a922ca61b90085 (patch)
tree9d2233f2437b8e85d151f9610b1a147310b9c13e /src/script.cpp
parent0b3d24c4295bb89eb4ce3f91163cabd64d0ca6e2 (diff)
parent95cc88ad5f6c2abb4890d00a57ae4ad0db030e9b (diff)
Merge pull request #1 from tcsullivan/save-load
Save load looks good
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();
}