diff options
author | sfan5 <sfan5@live.de> | 2020-04-26 20:57:27 +0200 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2020-04-27 06:58:34 +0200 |
commit | 8a03097450441cc7589507509bf755082a027cc7 (patch) | |
tree | 158d3c9ec46da3b184556c6606004eb74d2fa286 /src/script/lua_api | |
parent | d3f50f216f051186bcac34c7383829e1e7b929ff (diff) | |
download | minetest-8a03097450441cc7589507509bf755082a027cc7.tar.gz minetest-8a03097450441cc7589507509bf755082a027cc7.tar.bz2 minetest-8a03097450441cc7589507509bf755082a027cc7.zip |
script: Put getGuiEngine() inside a client-only #ifdef
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_base.cpp | 2 | ||||
-rw-r--r-- | src/script/lua_api/l_base.h | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/script/lua_api/l_base.cpp b/src/script/lua_api/l_base.cpp index c980bba39..b8658f62b 100644 --- a/src/script/lua_api/l_base.cpp +++ b/src/script/lua_api/l_base.cpp @@ -62,10 +62,12 @@ Environment *ModApiBase::getEnv(lua_State *L) return getScriptApiBase(L)->getEnv(); } +#ifndef SERVER GUIEngine *ModApiBase::getGuiEngine(lua_State *L) { return getScriptApiBase(L)->getGuiEngine(); } +#endif std::string ModApiBase::getCurrentModPath(lua_State *L) { diff --git a/src/script/lua_api/l_base.h b/src/script/lua_api/l_base.h index b46b5b567..e32647628 100644 --- a/src/script/lua_api/l_base.h +++ b/src/script/lua_api/l_base.h @@ -32,12 +32,12 @@ extern "C" { #ifndef SERVER class Client; +class GUIEngine; #endif class ScriptApiBase; class Server; class Environment; -class GUIEngine; class ModApiBase : protected LuaHelper { @@ -46,12 +46,13 @@ public: static Server* getServer(lua_State *L); #ifndef SERVER static Client* getClient(lua_State *L); + static GUIEngine* getGuiEngine(lua_State *L); #endif // !SERVER static IGameDef* getGameDef(lua_State *L); static Environment* getEnv(lua_State *L); - static GUIEngine* getGuiEngine(lua_State *L); + // When we are not loading the mod, this function returns "." static std::string getCurrentModPath(lua_State *L); |