]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/script/cpp_api/s_base.h
Merge branch 'master' of https://github.com/minetest/minetest
[dragonfireclient.git] / src / script / cpp_api / s_base.h
index 244d81605901b407fba659c5ef7148d3831bffd0..19ae8783b263e4471154a1329b6259dbdfe51731 100644 (file)
@@ -67,10 +67,12 @@ enum class ScriptingType: u8 {
 class Server;
 #ifndef SERVER
 class Client;
+class Game;
 #endif
 class IGameDef;
 class Environment;
 class GUIEngine;
+class ActiveObject;
 class ServerActiveObject;
 struct PlayerHPChangeReason;
 
@@ -97,14 +99,15 @@ class ScriptApiBase : protected LuaHelper {
                RunCallbacksMode mode, const char *fxn);
 
        /* object */
-       void addObjectReference(ServerActiveObject *cobj);
-       void removeObjectReference(ServerActiveObject *cobj);
+       void addObjectReference(ActiveObject *cobj);
+       void removeObjectReference(ActiveObject *cobj);
 
        IGameDef *getGameDef() { return m_gamedef; }
        Server* getServer();
        ScriptingType getType() { return m_type; }
 #ifndef SERVER
        Client* getClient();
+       Game *getGame() { return m_game; }
 #endif
 
        // IMPORTANT: these cannot be used for any security-related uses, they exist
@@ -145,6 +148,9 @@ class ScriptApiBase : protected LuaHelper {
        void stackDump(std::ostream &o);
 
        void setGameDef(IGameDef* gamedef) { m_gamedef = gamedef; }
+#ifndef SERVER
+       void setGame(Game *game) { m_game = game; }
+#endif
 
        Environment* getEnv() { return m_environment; }
        void setEnv(Environment* env) { m_environment = env; }
@@ -172,6 +178,9 @@ class ScriptApiBase : protected LuaHelper {
        lua_State      *m_luastack = nullptr;
 
        IGameDef       *m_gamedef = nullptr;
+#ifndef SERVER
+       Game       *m_game = nullptr;
+#endif
        Environment    *m_environment = nullptr;
 #ifndef SERVER
        GUIEngine      *m_guiengine = nullptr;