From b12510a4ac85fab211011d49a265cc914bc56aa6 Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Sat, 12 Oct 2024 18:04:41 +0200 Subject: [PATCH] Fix sorting by missing damage --- itemcontroller.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/itemcontroller.lua b/itemcontroller.lua index e11584f..487584b 100644 --- a/itemcontroller.lua +++ b/itemcontroller.lua @@ -288,7 +288,7 @@ local PAGES = { local function sortByDamage(invert, tiebreaker) return _genSort(function(v) local damage = v:getDamage() - return damage == 0 and 1 or (damage / v:getMaxDamage()) + return (damage == nil or damage == 0) and 1 or (damage / v:getMaxDamage()) end, invert, tiebreaker) end