1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix isNan on setYaw Lua call (#7380)

* Fix isNan on setYaw Lua call
This commit is contained in:
Loïc Blot 2018-05-31 22:52:08 +02:00 committed by GitHub
parent df991edaa8
commit 162ffd7fba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 1 deletions

View file

@ -21,7 +21,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "lua_api/l_internal.h"
#include "cpp_api/s_base.h"
#include "content/mods.h"
#include <server.h>
#include "server.h"
#include <cmath>
ScriptApiBase *ModApiBase::getScriptApiBase(lua_State *L)
{
@ -84,3 +85,8 @@ bool ModApiBase::registerFunction(lua_State *L, const char *name,
return true;
}
bool ModApiBase::isNaN(lua_State *L, int idx)
{
return lua_type(L, idx) == LUA_TNUMBER && std::isnan(lua_tonumber(L, idx));
}