Lua: Set package.path and package.cpath before onInit is called

This commit is contained in:
Lion Kortlepel
2021-09-17 02:19:45 +02:00
parent e75e65815c
commit bac476ec34
2 changed files with 37 additions and 1 deletions

View File

@@ -91,6 +91,7 @@ private:
[[nodiscard]] std::shared_ptr<TLuaResult> EnqueueScript(const std::shared_ptr<std::string>& Script);
[[nodiscard]] std::shared_ptr<TLuaResult> EnqueueFunctionCall(const std::string& FunctionName, const std::initializer_list<std::any>& Args);
void RegisterEvent(const std::string& EventName, const std::string& FunctionName);
void AddPath(const fs::path& Path); // to be added to path and cpath
void operator()() override;
private:
@@ -110,6 +111,8 @@ private:
std::recursive_mutex mStateFunctionQueueMutex;
TLuaEngine* mEngine;
sol::state_view mStateView { mState };
std::queue<fs::path> mPaths;
std::recursive_mutex mPathsMutex;
};
TNetwork* mNetwork;