mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
Fix Source:setEffect working incorrectly when a fourth or more arguments are passed
--HG-- branch : PabloMayobre/fix-seteffecteffect-true-and-geteffectef-1540253791471
This commit is contained in:
@@ -464,7 +464,7 @@ int w_Source_setEffect(lua_State *L)
|
|||||||
Source *t = luax_checksource(L, 1);
|
Source *t = luax_checksource(L, 1);
|
||||||
const char *namestr = luaL_checkstring(L, 2);
|
const char *namestr = luaL_checkstring(L, 2);
|
||||||
|
|
||||||
const bool isBool = lua_gettop(L) == 3 && lua_isboolean(L, 3);
|
const bool isBool = lua_gettop(L) >= 3 && lua_isboolean(L, 3);
|
||||||
|
|
||||||
// :setEffect(effect, false) = clear effect
|
// :setEffect(effect, false) = clear effect
|
||||||
if (isBool && !lua_toboolean(L, 3))
|
if (isBool && !lua_toboolean(L, 3))
|
||||||
|
|||||||
Reference in New Issue
Block a user