From d8faa632e563f3dd8ac45f30213e4a931d6ad2d6 Mon Sep 17 00:00:00 2001 From: oznogon Date: Fri, 27 Feb 2026 01:40:17 -0800 Subject: [PATCH] Add Lua Environment::getL() to process scripting environment --- src/script/environment.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/script/environment.h b/src/script/environment.h index b6d2fe0c..e3cb8865 100644 --- a/src/script/environment.h +++ b/src/script/environment.h @@ -1,5 +1,4 @@ -#ifndef SP_SCRIPT_ENVIRONMENT -#define SP_SCRIPT_ENVIRONMENT +#pragma once #include "stringImproved.h" #include "script/conversion.h" @@ -82,6 +81,8 @@ class Environment : NonCopyable } } + static lua_State* getL() { return L; } + private: template Result runImpl(const string& code, const string& name="=[string]") { int stack_size = lua_gettop(L); @@ -129,5 +130,3 @@ class Environment : NonCopyable }; } - -#endif//SP_SCRIPT_ENVIRONMENT