mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Use luaL_check/optinteger instead of luaL_check/optnumber when getting integer arguments to functions. Resolves issue #1251.
--HG-- branch : minor
This commit is contained in:
@@ -56,12 +56,12 @@ int w_Image_replacePixels(lua_State *L)
|
||||
|
||||
if (i->getTextureType() != TEXTURE_2D)
|
||||
{
|
||||
slice = (int) luaL_checknumber(L, 3) - 1;
|
||||
slice = (int) luaL_checkinteger(L, 3) - 1;
|
||||
if (!reloadmipmaps)
|
||||
mipmap = (int) luaL_optnumber(L, 4, 1) - 1;
|
||||
mipmap = (int) luaL_optinteger(L, 4, 1) - 1;
|
||||
}
|
||||
else if (!reloadmipmaps)
|
||||
mipmap = (int) luaL_optnumber(L, 3, 1) - 1;
|
||||
mipmap = (int) luaL_optinteger(L, 3, 1) - 1;
|
||||
|
||||
luax_catchexcept(L, [&](){ i->replacePixels(id, slice, mipmap, reloadmipmaps); });
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user