Skip to content
Snippets Groups Projects
Commit 16e0debf authored by Grayswandir's avatar Grayswandir
Browse files

Make it so that failing to apply an effect will not remove an existing

instance of it.
parent 35df6d86
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,7 @@ function _M:setEffect(eff_id, dur, p, silent)
p.dur = dur
p.effect_id = eff_id
self:check("on_set_temporary_effect", eff_id, _M.tempeffect_def[eff_id], p)
if p.dur <= 0 then return self:removeEffect(eff_id) end
if p.dur <= 0 then return end
-- If we already have it, we check if it knows how to "merge", or else we remove it and re-add it
if self:hasEffect(eff_id) then
......@@ -182,7 +182,7 @@ function _M:copyEffect(eff_id)
param.__tmpvals = nil
return param
end
end
--- Removes the effect
function _M:removeAllEffects()
......
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