Should this...
Code: Select all
-- If resources are too low, disable sustains
if self.mana < 1 or self.stamina < 1 or self.psi < 1 then
for tid, _ in pairs(self.sustain_talents) do
local t = self:getTalentFromId(tid)
if (t.sustain_mana and self.mana < 1) or (t.sustain_stamina and self.stamina < 1) or (t.sustain_psi and self.psi < 1) then
self:forceUseTalent(tid, {ignore_energy=true})
elseif (t.sustain_psi and self.psi < 1) and t.remove_on_zero then
self:forceUseTalent(tid, {ignore_energy=true})
end
end
end
Code: Select all
-- If resources are too low, disable sustains
if self.mana < 1 or self.stamina < 1 or self.psi < 1 then
for tid, _ in pairs(self.sustain_talents) do
local t = self:getTalentFromId(tid)
if (t.sustain_mana and self.mana < 1) or (t.sustain_stamina and self.stamina < 1) then
self:forceUseTalent(tid, {ignore_energy=true})
elseif (t.sustain_psi and self.psi < 1) and t.remove_on_zero then
self:forceUseTalent(tid, {ignore_energy=true})
end
end
end