Skip to content

Commit

Permalink
Fix minetest.is_nan
Browse files Browse the repository at this point in the history
  • Loading branch information
appgurueu authored and sfan5 committed Dec 24, 2020
1 parent 7476247 commit 8f72d4b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
4 changes: 4 additions & 0 deletions builtin/common/misc_helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -697,3 +697,7 @@ function core.privs_to_string(privs, delim)
end
return table.concat(list, delim)
end

function core.is_nan(number)
return number ~= number
end
11 changes: 0 additions & 11 deletions src/script/lua_api/l_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,6 @@ int ModApiUtil::l_is_yes(lua_State *L)
return 1;
}

// is_nan(arg)
int ModApiUtil::l_is_nan(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;

lua_pushboolean(L, isNaN(L, 1));
return 1;
}

// get_builtin_path()
int ModApiUtil::l_get_builtin_path(lua_State *L)
{
Expand Down Expand Up @@ -493,7 +484,6 @@ void ModApiUtil::Initialize(lua_State *L, int top)
API_FCT(get_password_hash);

API_FCT(is_yes);
API_FCT(is_nan);

API_FCT(get_builtin_path);

Expand Down Expand Up @@ -526,7 +516,6 @@ void ModApiUtil::InitializeClient(lua_State *L, int top)
API_FCT(write_json);

API_FCT(is_yes);
API_FCT(is_nan);

API_FCT(compress);
API_FCT(decompress);
Expand Down
3 changes: 0 additions & 3 deletions src/script/lua_api/l_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ class ModApiUtil : public ModApiBase
// is_yes(arg)
static int l_is_yes(lua_State *L);

// is_nan(arg)
static int l_is_nan(lua_State *L);

// get_builtin_path()
static int l_get_builtin_path(lua_State *L);

Expand Down

0 comments on commit 8f72d4b

Please sign in to comment.