Skip to content

Commit

Permalink
consider a valid ammo bag to be an upgrade if the equipped ammo bag i…
Browse files Browse the repository at this point in the history
…s invalid for the best known weapon, regardless of the valid ammo bag's score
  • Loading branch information
AlexFolland committed Feb 16, 2024
1 parent 6e319e9 commit c5db01c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions AutoGear.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2867,15 +2867,9 @@ function AutoGearConsiderItem(info, bag, slot, rollOn, chooseReward)
or AutoGearBestItems[lowestScoringValidGearSlot].info.empty
or AutoGearBestItems[lowestScoringValidGearSlot].info.unusable
or (info.isAmmoBag
and (score > lowestScoringValidGearSlotScore)
and AutoGearIsAmmoBagValidForRangedWeapon(
info,
(
(AutoGearBestItems and AutoGearBestItems[INVSLOT_RANGED])
and AutoGearBestItems[INVSLOT_RANGED].info
or AutoGearReadItemInfo(INVSLOT_RANGED)
)
)
and AutoGearIsAmmoBagValidForBestKnownRangedWeapon(info)
and ((score > lowestScoringValidGearSlotScore)
or (not AutoGearIsAmmoBagValidForBestKnownRangedWeapon(AutoGearBestItems[lowestScoringValidGearSlot].info)))
)
) then
AutoGearBestItemsAlreadyAdded[info.link] = 1
Expand All @@ -2892,6 +2886,15 @@ function AutoGearConsiderItem(info, bag, slot, rollOn, chooseReward)
end
end

function AutoGearIsAmmoBagValidForBestKnownRangedWeapon(info)
return AutoGearIsAmmoBagValidForRangedWeapon (
info,
(AutoGearBestItems and AutoGearBestItems[INVSLOT_RANGED])
and AutoGearBestItems[INVSLOT_RANGED].info
or AutoGearReadItemInfo(INVSLOT_RANGED)
)
end

function AutoGearInitializeEquippableBagSlotsTable()
for i = BACKPACK_CONTAINER+1, NUM_BAG_SLOTS do
table.insert(AutoGearEquippableBagSlots, AutoGearFirstEquippableBagSlot+i-1)
Expand Down

0 comments on commit c5db01c

Please sign in to comment.