diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-04-30 14:58:55 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-04-30 14:58:55 +1000 |
commit | d8db6199e13b5405123f18cc1a9631f7e7f4794a (patch) | |
tree | e1f0bf9b2b6b5210c658da37034b825fa3c054c3 /source/game | |
parent | 9a0ad03cba6ac00588fcaa89c7cb0b973e00b59b (diff) |
move WorldServer universe callbacks to the shared LuaRoot so it's available in entity scripts
Diffstat (limited to 'source/game')
-rw-r--r-- | source/game/StarWorldServer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/game/StarWorldServer.cpp b/source/game/StarWorldServer.cpp index 5796b65..3bc067a 100644 --- a/source/game/StarWorldServer.cpp +++ b/source/game/StarWorldServer.cpp @@ -103,11 +103,11 @@ void WorldServer::setReferenceClock(ClockPtr clock) { } void WorldServer::initLua(UniverseServer* universe) { + m_luaRoot->addCallbacks("universe", LuaBindings::makeUniverseServerCallbacks(universe)); auto assets = Root::singleton().assets(); for (auto& p : assets->json("/worldserver.config:scriptContexts").toObject()) { auto scriptComponent = make_shared<ScriptComponent>(); scriptComponent->setScripts(jsonToStringList(p.second.toArray())); - scriptComponent->addCallbacks("universe", LuaBindings::makeUniverseServerCallbacks(universe)); m_scriptContexts.set(p.first, scriptComponent); scriptComponent->init(this); |