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

Add minetest.is_singleplayer()

This commit is contained in:
Perttu Ahola 2012-03-28 13:22:48 +03:00
parent 9e0f969b8b
commit ae7aa65069
3 changed files with 11 additions and 0 deletions

View file

@ -3840,6 +3840,13 @@ static int l_sound_stop(lua_State *L)
return 0;
}
// is_singleplayer()
static int l_is_singleplayer(lua_State *L)
{
lua_pushboolean(L, get_server(L)->isSingleplayer());
return 1;
}
static const struct luaL_Reg minetest_f [] = {
{"debug", l_debug},
{"log", l_log},
@ -3859,6 +3866,7 @@ static const struct luaL_Reg minetest_f [] = {
{"get_worldpath", l_get_worldpath},
{"sound_play", l_sound_play},
{"sound_stop", l_sound_stop},
{"is_singleplayer", l_is_singleplayer},
{NULL, NULL}
};