Quantcast

Make the start "winner" score (- math.huge) instead of 0

James Whitehead II [08-17-08 - 12:21]
Make the start "winner" score (- math.huge) instead of 0
Filename
DressToKill.lua
diff --git a/DressToKill.lua b/DressToKill.lua
index 406b6f9..d589dc3 100644
--- a/DressToKill.lua
+++ b/DressToKill.lua
@@ -159,7 +159,7 @@ local function scanFunction(weightFunction)
 	local linen_shirt = "\124cffffffff\124Hitem:2576:0:0:0:0:0:0:0\124h[White Linen Shirt]\124h\124r"
 	local mh_base = weightFunction(linen_shirt, mainslot) or 0
 	local oh_base = mh_base
-	local weapon_max, weapon_win = 0, {}
+	local weapon_max, weapon_win = (- math.huge), {}

 	debug(L["Weapon base score: %s"], mh_base)

@@ -241,7 +241,7 @@ local function scanFunction(weightFunction)
 	local stash = {}
 	-- Loop through all of the inventory slots
 	for slotId,avail in pairs(slotAvail) do
-		local maxScore, winner = 0, nil
+		local maxScore, winner = (- math.huge), nil
 		local link = GetInventoryItemLink("player", slotId)
 		if link then
 			-- We current have an item equipped, so stash that item elsewhere