summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_nodetimer.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2020-04-11 19:59:43 +0200
committerGitHub <noreply@github.com>2020-04-11 19:59:43 +0200
commit5cc06e4748a82acb36310fee89e72f30b2b35a36 (patch)
treebf99c5498f491c831c8494c064f2be5502f4bdf0 /src/script/lua_api/l_nodetimer.h
parent5146086a64d5eeb480948d612a008a2ec81455d4 (diff)
downloadminetest-5cc06e4748a82acb36310fee89e72f30b2b35a36.tar.gz
minetest-5cc06e4748a82acb36310fee89e72f30b2b35a36.tar.bz2
minetest-5cc06e4748a82acb36310fee89e72f30b2b35a36.zip
Reduce ServerEnvironment propagation (#9642)
ServerEnvironment is a huge class with many accessors. In various places it's not needed Remove it to reduce the ServerEnvironment view. Idea here is to reduce size of some of our objects to transport lightweight managers and permit easier testing Pathfinder is now tied to a generic map, not a ServerMap, it can be ported to client
Diffstat (limited to 'src/script/lua_api/l_nodetimer.h')
-rw-r--r--src/script/lua_api/l_nodetimer.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/script/lua_api/l_nodetimer.h b/src/script/lua_api/l_nodetimer.h
index b894c5c8c..bbc975fd2 100644
--- a/src/script/lua_api/l_nodetimer.h
+++ b/src/script/lua_api/l_nodetimer.h
@@ -22,13 +22,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "irr_v3d.h"
#include "lua_api/l_base.h"
-class ServerEnvironment;
+class ServerMap;
class NodeTimerRef : public ModApiBase
{
private:
v3s16 m_p;
- ServerEnvironment *m_env = nullptr;
+ ServerMap *m_map;
static const char className[];
static const luaL_Reg methods[];
@@ -50,14 +50,12 @@ private:
static int l_get_elapsed(lua_State *L);
public:
- NodeTimerRef(v3s16 p, ServerEnvironment *env);
+ NodeTimerRef(v3s16 p, ServerMap *map) : m_p(p), m_map(map) {}
~NodeTimerRef() = default;
// Creates an NodeTimerRef and leaves it on top of stack
// Not callable from Lua; all references are created on the C side.
- static void create(lua_State *L, v3s16 p, ServerEnvironment *env);
-
- static void set_null(lua_State *L);
+ static void create(lua_State *L, v3s16 p, ServerMap *map);
static void Register(lua_State *L);
};