Fixed bug related to BodyLocations that would break equipping prosthesis

This commit is contained in:
ZioPao
2024-05-07 17:04:32 +02:00
parent c1faeeaabf
commit 26e0324f4a

View File

@@ -132,6 +132,17 @@ function ISClothingExtraAction:isValid()
return HandleProsthesisValidation(testItem, isEquippable) return HandleProsthesisValidation(testItem, isEquippable)
end end
local og_ISClothingExtraAction_perform = ISClothingExtraAction.perform
function ISClothingExtraAction:perform()
local extraItem = InventoryItemFactory.CreateItem(self.extra)
ProsthesisHandler.SearchAndSetupProsthesis(extraItem, true)
og_ISClothingExtraAction_perform(self)
end
local og_ISUnequipAction_perform = ISUnequipAction.perform
function ISUnequipAction:perform()
--[[ --[[
Horrendous workaround Horrendous workaround
@@ -141,27 +152,6 @@ end
disable and re-enable the multi-item bool for the Unequip Action. disable and re-enable the multi-item bool for the Unequip Action.
]] ]]
local og_ISClothingExtraAction_perform = ISClothingExtraAction.perform
function ISClothingExtraAction:perform()
local extraItem = InventoryItemFactory.CreateItem(self.extra)
local isProst = ProsthesisHandler.SearchAndSetupProsthesis(extraItem, true)
local group
if isProst then
group = BodyLocations.getGroup("Human")
group:setMultiItem("TOC_ArmProst", false)
end
og_ISClothingExtraAction_perform(self)
if isProst then
group:setMultiItem("TOC_ArmProst", true)
end
end
local og_ISUnequipAction_perform = ISUnequipAction.perform
function ISUnequipAction:perform()
local isProst = ProsthesisHandler.SearchAndSetupProsthesis(self.item, false) local isProst = ProsthesisHandler.SearchAndSetupProsthesis(self.item, false)
local group local group
if isProst then if isProst then