aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_util.cpp
diff options
context:
space:
mode:
authorPilzAdam <pilzadam@minetest.net>2013-09-09 22:50:25 +0200
committerPilzAdam <pilzadam@minetest.net>2013-09-10 18:31:38 +0200
commitd820a6bfd807b6d181a858f3ea8a0d0f5c2b1879 (patch)
tree23b6052c527213c854289b1a5ea742897a130fd4 /src/script/lua_api/l_util.cpp
parent10a38a3005e420ec16a821117bf9f025b6e2c61b (diff)
downloadminetest-d820a6bfd807b6d181a858f3ea8a0d0f5c2b1879.tar.gz
minetest-d820a6bfd807b6d181a858f3ea8a0d0f5c2b1879.tar.bz2
minetest-d820a6bfd807b6d181a858f3ea8a0d0f5c2b1879.zip
Add Settings interface for Lua
Diffstat (limited to 'src/script/lua_api/l_util.cpp')
-rw-r--r--src/script/lua_api/l_util.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp
index 30fa56c42..34788accd 100644
--- a/src/script/lua_api/l_util.cpp
+++ b/src/script/lua_api/l_util.cpp
@@ -220,6 +220,16 @@ int ModApiUtil::l_get_password_hash(lua_State *L)
return 1;
}
+// is_yes(string)
+int ModApiUtil::l_is_yes(lua_State *L)
+{
+ NO_MAP_LOCK_REQUIRED;
+ std::string str = luaL_checkstring(L, 1);
+ bool yes = is_yes(str);
+ lua_pushboolean(L, yes);
+ return 1;
+}
+
void ModApiUtil::Initialize(lua_State *L, int top)
{
API_FCT(debug);
@@ -237,5 +247,7 @@ void ModApiUtil::Initialize(lua_State *L, int top)
API_FCT(get_hit_params);
API_FCT(get_password_hash);
+
+ API_FCT(is_yes);
}