From d0307e7aa77ddc8d15b6d1e036e563f3c9150287 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Thu, 20 Jul 2023 17:53:57 +1000 Subject: [PATCH] Add celestial callbacks to UniverseClient scripts --- source/game/StarCelestialDatabase.cpp | 2 +- source/game/StarUniverseClient.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/game/StarCelestialDatabase.cpp b/source/game/StarCelestialDatabase.cpp index ac9f14f..d5ba7df 100644 --- a/source/game/StarCelestialDatabase.cpp +++ b/source/game/StarCelestialDatabase.cpp @@ -207,7 +207,7 @@ bool CelestialMasterDatabase::coordinateValid(CelestialCoordinate const& coordin Maybe CelestialMasterDatabase::findRandomWorld(unsigned tries, unsigned trySpatialRange, function filter, Maybe seed) { //RecursiveMutexLocker locker(m_mutex); - // We don't need this mutex, the other calls are locking anyway. + // We don't need this lock, the other calls are locking anyway. // Having this here is just stopping other threads from having a go in here until we've found a world. RandomSource randSource; if (seed) diff --git a/source/game/StarUniverseClient.cpp b/source/game/StarUniverseClient.cpp index bc1b0b9..35a74b0 100644 --- a/source/game/StarUniverseClient.cpp +++ b/source/game/StarUniverseClient.cpp @@ -22,6 +22,7 @@ #include "StarQuestManager.hpp" #include "StarPlayerUniverseMap.hpp" #include "StarWorldTemplate.hpp" +#include "StarCelestialLuaBindings.hpp" namespace Star { @@ -449,6 +450,8 @@ void UniverseClient::setLuaCallbacks(String const& groupName, LuaCallbacks const } void UniverseClient::startLua() { + setLuaCallbacks("celestial", LuaBindings::makeCelestialCallbacks(this)); + auto assets = Root::singleton().assets(); for (auto& p : assets->json("/client.config:universeScriptContexts").toObject()) { auto scriptComponent = make_shared();