Updated rewrite with previous loot all fix

This commit is contained in:
Pao
2023-03-07 19:38:22 +01:00
parent cb388b803f
commit fd18ffb35f
2 changed files with 29 additions and 0 deletions

View File

@@ -246,4 +246,23 @@ function ISClothingExtraAction:isValid()
end
return baseCheck
end
-- Manages the Loot All button to prevent stuff like picking up the amputation items
local og_ISInventoryPagePrerender = ISInventoryPage.prerender
function ISInventoryPage:prerender()
-- Check if there is any amputated limb here. if there is, just fail and maybe notify the player
og_ISInventoryPagePrerender(self)
if TOC_Common.FindModItem(self.inventory) then
self.canLootAll = false
else
self.canLootAll = true
end
end
local og_ISInventoryPageLootAll = ISInventoryPage.lootAll
function ISInventoryPage:lootAll()
if self.canLootAll then
og_ISInventoryPageLootAll(self)
end
end