From ae7aa65069983003343af8af5274df2e12ba5393 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Wed, 28 Mar 2012 13:22:48 +0300 Subject: Add minetest.is_singleplayer() --- src/scriptapi.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/scriptapi.cpp') diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index 23c18473f..d2ded57c6 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -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} }; -- cgit v1.2.3