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

Fixed sorting and made log messages more enticing.

parent 16456447
No related branches found
No related tags found
No related merge requests found
......@@ -855,7 +855,7 @@ function _M:automaticTalents()
local cd = self:getTalentCooldown(t) or 0
local turns_used = util.getval(t.no_energy, self, t) == true and 0 or 1
if cd <= turns_used then
game.logPlayer(self, "Automatic use of talent %s skipped: cooldown too low (%d).", t.name, cd)
game.logPlayer(self, "Automatic use of talent %s #DARK_RED#skipped#LAST#: cooldown too low (%d).", t.name, cd)
elseif (t.mode ~= "sustained" or not self.sustain_talents[tid]) and not self.talents_cd[tid] and self:preUseTalent(t, true, true) and (not t.auto_use_check or t.auto_use_check(self, t)) then
if (c == 1) or (c == 2 and #spotted <= 0) or (c == 3 and #spotted > 0) then
if c ~= 2 then
......@@ -876,7 +876,7 @@ function _M:automaticTalents()
end
end
table.sort(uses, function(a, b)
local an, nb = a.tunrs_used, b.turns_used
local an, nb = a.turns_used, b.turns_used
if an < nb then return true
elseif an > nb then return false
else
......
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