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:
Pablo Mayobre
2018-11-30 04:01:52 +00:00
parent e840631388
commit 1670edf4ba
+1 -1
View File
@@ -464,7 +464,7 @@ int w_Source_setEffect(lua_State *L)
Source *t = luax_checksource(L, 1);
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
if (isBool && !lua_toboolean(L, 3))