Skip to content

Commit

Permalink
Prevent divide-by-zero from trinket buffs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hekili committed Oct 15, 2023
1 parent 38db95e commit eacee87
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -755,12 +755,12 @@ do
local ability = class.abilities[ tSpell ]
local aura = ability and class.auras[ ability.self_buff or spellID ]

if spellID and SpellIsSelfBuff( spellID ) then
state.trinket.t1.__has_use_buff = not ( aura and aura.ignore_buff ) and not ( ability and ability.proc and ( ability.proc == "damage" or ability.proc == "healing" or ability.proc == "mana" or ability.proc == "absorb" or ability.proc == "speed" ) )
state.trinket.t1.__use_buff_duration = aura and aura.duration or 0.01
if spellID and SpellIsSelfBuff( spellID ) and aura then
state.trinket.t1.__has_use_buff = not aura.ignore_buff and not ( ability and ability.proc and ( ability.proc == "damage" or ability.proc == "healing" or ability.proc == "mana" or ability.proc == "absorb" or ability.proc == "speed" ) )
state.trinket.t1.__use_buff_duration = aura.duration > 0 and aura.duration or 0.01
elseif ability.self_buff then
state.trinket.t1.__has_use_buff = true
state.trinket.t1.__use_buff_duration = aura and aura.duration or 0.01
state.trinket.t1.__use_buff_duration = aura and aura.duration > 0 and aura.duration or 0.01
end
end

Expand Down Expand Up @@ -795,12 +795,12 @@ do
local ability = class.abilities[ tSpell ]
local aura = class.auras[ ability.self_buff or spellID ]

if spellID and SpellIsSelfBuff( spellID ) then
state.trinket.t2.__has_use_buff = not ( aura and aura.ignore_buff ) and not ( ability and ability.proc and ( ability.proc == "damage" or ability.proc == "healing" or ability.proc == "mana" or ability.proc == "absorb" or ability.proc == "speed" ) )
state.trinket.t2.__use_buff_duration = aura and aura.duration or 0.01
if spellID and SpellIsSelfBuff( spellID ) and aura then
state.trinket.t2.__has_use_buff = not aura.ignore_buff and not ( ability and ability.proc and ( ability.proc == "damage" or ability.proc == "healing" or ability.proc == "mana" or ability.proc == "absorb" or ability.proc == "speed" ) )
state.trinket.t2.__use_buff_duration = aura.duration > 0 and aura.duration or 0.01
elseif ability.self_buff then
state.trinket.t2.__has_use_buff = true
state.trinket.t2.__use_buff_duration = aura and aura.duration or 0.01
state.trinket.t2.__use_buff_duration = aura and aura.duration > 0 and aura.duration or 0.01
end
end

Expand Down

0 comments on commit eacee87

Please sign in to comment.