summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_modchannels.h
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2018-06-27 16:45:40 +0100
committerSmallJoker <SmallJoker@users.noreply.github.com>2018-06-27 17:45:40 +0200
commite36af6f9692993def310cc48ab5c2f65fb0f0267 (patch)
treed8af1b4fd0e1070469b4506d42f1cc9a7cb6b566 /src/script/lua_api/l_modchannels.h
parenta43a4e2d97d52f0e5e6e62e472a577e434d892eb (diff)
downloadminetest-e36af6f9692993def310cc48ab5c2f65fb0f0267.tar.gz
minetest-e36af6f9692993def310cc48ab5c2f65fb0f0267.tar.bz2
minetest-e36af6f9692993def310cc48ab5c2f65fb0f0267.zip
Fix mod channels crash (#7481)
Diffstat (limited to 'src/script/lua_api/l_modchannels.h')
-rw-r--r--src/script/lua_api/l_modchannels.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/script/lua_api/l_modchannels.h b/src/script/lua_api/l_modchannels.h
index dbbf11a05..9b948002b 100644
--- a/src/script/lua_api/l_modchannels.h
+++ b/src/script/lua_api/l_modchannels.h
@@ -37,11 +37,11 @@ public:
class ModChannelRef : public ModApiBase
{
public:
- ModChannelRef(ModChannel *modchannel);
+ ModChannelRef(const std::string &modchannel);
~ModChannelRef() = default;
static void Register(lua_State *L);
- static void create(lua_State *L, ModChannel *channel);
+ static void create(lua_State *L, const std::string &channel);
// leave()
static int l_leave(lua_State *L);
@@ -57,9 +57,9 @@ private:
static int gc_object(lua_State *L);
static ModChannelRef *checkobject(lua_State *L, int narg);
- static ModChannel *getobject(ModChannelRef *ref);
+ static ModChannel *getobject(lua_State *L, ModChannelRef *ref);
- ModChannel *m_modchannel = nullptr;
+ std::string m_modchannel_name;
static const char className[];
static const luaL_Reg methods[];