aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_util.cpp
diff options
context:
space:
mode:
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);
}