Skip to content
Snippets Groups Projects
Commit c013c73f authored by Tomas's avatar Tomas Committed by est31
Browse files

Lua->C getintfield() use lua_tointeger (#4408)

previously function used tonumber which returned float
this caused errors in large numbers and resulted in
obj-def-handlers being invalid when retrived from lua tables in c
parent 4503b509
No related branches found
No related tags found
No related merge requests found
......@@ -391,7 +391,7 @@ bool getintfield(lua_State *L, int table,
lua_getfield(L, table, fieldname);
bool got = false;
if(lua_isnumber(L, -1)){
result = lua_tonumber(L, -1);
result = lua_tointeger(L, -1);
got = true;
}
lua_pop(L, 1);
......@@ -404,7 +404,7 @@ bool getintfield(lua_State *L, int table,
lua_getfield(L, table, fieldname);
bool got = false;
if(lua_isnumber(L, -1)){
result = lua_tonumber(L, -1);
result = lua_tointeger(L, -1);
got = true;
}
lua_pop(L, 1);
......@@ -417,7 +417,7 @@ bool getintfield(lua_State *L, int table,
lua_getfield(L, table, fieldname);
bool got = false;
if(lua_isnumber(L, -1)){
result = lua_tonumber(L, -1);
result = lua_tointeger(L, -1);
got = true;
}
lua_pop(L, 1);
......@@ -430,7 +430,7 @@ bool getintfield(lua_State *L, int table,
lua_getfield(L, table, fieldname);
bool got = false;
if(lua_isnumber(L, -1)){
result = lua_tonumber(L, -1);
result = lua_tointeger(L, -1);
got = true;
}
lua_pop(L, 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment