Use lua_tointeger instead of lua_tonumber

This commit is contained in:
Pasi Kallinen
2019-11-07 19:28:58 +02:00
parent 293082079c
commit 4e438e0146
3 changed files with 9 additions and 9 deletions

View File

@@ -4534,7 +4534,7 @@ int tableidx, entrynum;
lua_pushinteger(L, entrynum);
lua_gettable(L, tableidx);
if (lua_isnumber(L, -1)) {
ret = lua_tonumber(L, -1);
ret = lua_tointeger(L, -1);
} else {
char buf[BUFSZ];
Sprintf(buf, "Array entry #%i is %s, expected number",
@@ -4564,7 +4564,7 @@ boolean optional;
luaL_checktype(L, -1, LUA_TTABLE);
lua_len(L, -1);
arrlen = lua_tonumber(L, -1);
arrlen = lua_tointeger(L, -1);
lua_pop(L, 1);
if (arrlen != 4) {
nhl_error(L, "Not a region");
@@ -4591,7 +4591,7 @@ int *x, *y;
int arrlen;
lua_len(L, index);
arrlen = lua_tonumber(L, -1);
arrlen = lua_tointeger(L, -1);
lua_pop(L, 1);
if (arrlen != 2) {
nhl_error(L, "Not a coordinate");