diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2019-09-18 12:10:25 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2019-09-18 12:10:25 -0400 |
commit | 0e7f7791fd592f0240a30168a9a570c57b0f5880 (patch) | |
tree | be4e0a598112748030412c452e0a7c24f45ef665 /src/script.cpp | |
parent | 145d74e433216f8c17475685c553321ca4cbedf3 (diff) | |
parent | 2cedd39a90fdb0387783b50446b16732517fb651 (diff) |
adjust for world changes
Diffstat (limited to 'src/script.cpp')
-rw-r--r-- | src/script.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/script.cpp b/src/script.cpp index ec8f5c7..6cda627 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -187,10 +187,6 @@ sol::table ScriptSystem::spawn(sol::object param) e.assign<Velocity>(Velocity().FromLua(tab["Velocity"])).get(); } - if (tab["Player"] != nullptr) { - (*toRet)["Player"] = e.assign<Player>().get(); - } - if (tab["Physics"] != nullptr) { if (!e.has_component<Position>()) // Position must exist for phys. (*toRet)["Position"] = e.assign<Position>().get(); @@ -213,6 +209,10 @@ sol::table ScriptSystem::spawn(sol::object param) e.assign<EventListener>(listeners); } + if (tab["Player"] != nullptr) { + (*toRet)["Player"] = e.assign<Player>().get(); + } + } else { // TODO better logging std::cerr << "Parameter to spawn() must be a table!" << std::endl; |