Avoid luaL_checkint and luaL_optint, they're not available in Lua 5.4.

Fixes #2102.
This commit is contained in:
Sasha Szpakowski
2025-01-18 20:37:53 -04:00
parent 4e8291fd7e
commit 5b4ced266d
4 changed files with 30 additions and 15 deletions
+4 -4
View File
@@ -163,10 +163,10 @@ int w_ImageData_mapPixel(lua_State *L)
ImageData *t = luax_checkimagedata(L, 1);
luaL_checktype(L, 2, LUA_TFUNCTION);
int sx = luaL_optint(L, 3, 0);
int sy = luaL_optint(L, 4, 0);
int w = luaL_optint(L, 5, t->getWidth());
int h = luaL_optint(L, 6, t->getHeight());
int sx = luax_optint(L, 3, 0);
int sy = luax_optint(L, 4, 0);
int w = luax_optint(L, 5, t->getWidth());
int h = luax_optint(L, 6, t->getHeight());
if (!(t->inside(sx, sy) && t->inside(sx+w-1, sy+h-1)))
return luaL_error(L, "Invalid rectangle dimensions.");