an < bn blows up when these are null. Check for null before doing a comparison.
Deleting this condition restores previous functionality, which works okay.
Code: Select all
diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player
index 83a68b5..5c940b8 100644
--- a/game/modules/tome/class/Player.lua
+++ b/game/modules/tome/class/Player.lua
@@ -828,13 +828,13 @@ function _M:automaticTalents()
end
table.sort(uses, function(a, b)
local an, nb = util.getval(a.no_energy, self, a), util.getval(b.
- if an < bn then return true
- elseif an > bn then return false
- else
+-- if an < bn then return true
+-- elseif an > bn then return false
+-- else
if a.cd > b.cd then return true
else return false
end
- end
+-- end
end)
table.print(uses)
for _, use in ipairs(uses) do