Fix multiple onShutdown() calls
struct ScriptContext
{
ScriptContext(sol::state_view aStateView, const std::filesystem::path& acPath);
+ ScriptContext(ScriptContext&& other) noexcept : ScriptContext(other)
+ {
+ other.m_initialized = false;
+ }
~ScriptContext();
[[nodiscard]] bool IsValid() const;
@@ -19,6 +23,8 @@ protected:
private:
+ ScriptContext(const ScriptContext&) = default;
+
sol::state_view m_lua;
sol::environment m_env;
sol::object m_object;
