Skip to content
Snippets Groups Projects
Commit 79a919e9 authored by Alex Ksandra's avatar Alex Ksandra
Browse files

removeEffectsFilter now is not limited by effects' number.

parent 4f19099e
No related branches found
No related tags found
No related merge requests found
......@@ -5515,7 +5515,6 @@ end
--- Remove all effects based on a filter
function _M:removeEffectsFilter(t, nb, silent, force)
nb = nb or 100000
local effs = {}
local removed = 0
......@@ -5528,11 +5527,18 @@ function _M:removeEffectsFilter(t, nb, silent, force)
end
end
while #effs > 0 and nb > 0 do
local eff = rng.tableRemove(effs)
self:removeEffect(eff, silent, force)
nb = nb - 1
removed = removed + 1
if nb then
while #effs > 0 and nb > 0 do
local eff = rng.tableRemove(effs)
self:removeEffect(eff, silent, force)
nb = nb - 1
removed = removed + 1
end
else
removed = #effs
for i = 1,#effs do
self:removeEffect(effs[i], silent, force)
end
end
return removed
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment