From fec496f154ad8a68573c228ab9b4277af1517510 Mon Sep 17 00:00:00 2001 From: ttrebuchon Date: Wed, 1 Feb 2023 12:30:52 -0500 Subject: [PATCH] Fix missing check for b.unlimited~=true in sortpayloads function. --- Moose Development/Moose/Ops/AirWing.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/AirWing.lua b/Moose Development/Moose/Ops/AirWing.lua index fe0d22de5..4cfbe36a7 100644 --- a/Moose Development/Moose/Ops/AirWing.lua +++ b/Moose Development/Moose/Ops/AirWing.lua @@ -524,7 +524,7 @@ function AIRWING:FetchPayloadFromStock(UnitType, MissionType, Payloads) if a and b then -- I had the case that a or b were nil even though the self.payloads table was looking okay. Very strange! Seems to be solved by pre-selecting valid payloads. local performanceA=self:GetPayloadPeformance(a, MissionType) local performanceB=self:GetPayloadPeformance(b, MissionType) - return (performanceA>performanceB) or (performanceA==performanceB and a.unlimited==true) or (performanceA==performanceB and a.unlimited==true and b.unlimited==true and a.navail>b.navail) + return (performanceA>performanceB) or (performanceA==performanceB and a.unlimited==true and b.unlimited~=true) or (performanceA==performanceB and a.unlimited==true and b.unlimited==true and a.navail>b.navail) elseif not a then self:I(self.lid..string.format("FF ERROR in sortpayloads: a is nil")) return false