1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Lua on each mapgen thread (#13092)

This commit is contained in:
sfan5 2024-02-13 22:47:30 +01:00 committed by GitHub
parent d4b107e2e8
commit 3cac17d23e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 1329 additions and 193 deletions

View file

@ -61,13 +61,15 @@ enum class ScriptingType: u8 {
Async, // either mainmenu (client) or ingame (server)
Client,
MainMenu,
Server
Server,
Emerge
};
class Server;
#ifndef SERVER
class Client;
#endif
class EmergeThread;
class IGameDef;
class Environment;
class GUIEngine;
@ -158,6 +160,9 @@ protected:
void setGuiEngine(GUIEngine* guiengine) { m_guiengine = guiengine; }
#endif
EmergeThread* getEmergeThread() { return m_emerge; }
void setEmergeThread(EmergeThread *emerge) { m_emerge = emerge; }
void objectrefGetOrCreate(lua_State *L, ServerActiveObject *cobj);
void pushPlayerHPChangeReason(lua_State *L, const PlayerHPChangeReason& reason);
@ -180,5 +185,7 @@ private:
#ifndef SERVER
GUIEngine *m_guiengine = nullptr;
#endif
EmergeThread *m_emerge = nullptr;
ScriptingType m_type;
};