^ Useful for loading additional .lua modules or static data from mod
minetest.get_worldpath() -> eg. "/home/user/.minetest/world"
^ Useful for storing custom data
+minetest.is_singleplayer()
minetest.debug(line)
^ Goes to dstream
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},
{"get_worldpath", l_get_worldpath},
{"sound_play", l_sound_play},
{"sound_stop", l_sound_stop},
+ {"is_singleplayer", l_is_singleplayer},
{NULL, NULL}
};
std::string getWorldPath(){ return m_path_world; }
+ bool isSingleplayer(){ return m_simple_singleplayer_mode; }
+
void setAsyncFatalError(const std::string &error)
{
m_async_fatal_error.set(error);