fix: switched to multiple body locs to fix some old issues and prepare for better visuals overhaul
This commit is contained in:
@@ -78,13 +78,16 @@ end
|
||||
---Deletes all the old amputation items, used for resets
|
||||
---@param playerObj IsoPlayer
|
||||
function ItemsController.Player.DeleteAllOldAmputationItems(playerObj)
|
||||
-- TODO Fix visual bug
|
||||
-- This part is a workaround for a pretty shitty implementation on the java side. Check ProsthesisHandler for more infos
|
||||
local group = BodyLocations.getGroup("Human")
|
||||
group:setMultiItem("TOC_Arm", false)
|
||||
group:setMultiItem("TOC_ArmProst", false)
|
||||
-- local group = BodyLocations.getGroup("Human")
|
||||
-- group:setMultiItem("TOC_Arm", false)
|
||||
-- group:setMultiItem("TOC_ArmProst", false)
|
||||
|
||||
for i = 1, #StaticData.LIMBS_STR do
|
||||
local limbName = StaticData.LIMBS_STR[i]
|
||||
|
||||
-- TODO Won't work with dedicated clothingItems for multi amps
|
||||
local clothItemName = StaticData.AMPUTATION_CLOTHING_ITEM_BASE .. limbName
|
||||
local clothItem = playerObj:getInventory():FindAndReturn(clothItemName)
|
||||
---@cast clothItem InventoryItem
|
||||
@@ -93,8 +96,8 @@ function ItemsController.Player.DeleteAllOldAmputationItems(playerObj)
|
||||
-- Reset model just in case
|
||||
playerObj:resetModel()
|
||||
|
||||
group:setMultiItem("TOC_Arm", true)
|
||||
group:setMultiItem("TOC_ArmProst", true)
|
||||
-- group:setMultiItem("TOC_Arm", true)
|
||||
-- group:setMultiItem("TOC_ArmProst", true)
|
||||
end
|
||||
|
||||
---Spawns and equips the correct amputation item to the player.
|
||||
|
||||
@@ -64,18 +64,18 @@ end
|
||||
---@param obj any self
|
||||
---@param wrappedFunc function
|
||||
function TourniquetController.WrapClothingAction(obj, wrappedFunc)
|
||||
local isTourniquet = TourniquetController.IsItemTourniquet(obj.item:getFullType())
|
||||
local group
|
||||
if isTourniquet then
|
||||
group = BodyLocations.getGroup("Human")
|
||||
group:setMultiItem(TourniquetController.bodyLoc, false)
|
||||
end
|
||||
-- local isTourniquet = TourniquetController.IsItemTourniquet(obj.item:getFullType())
|
||||
-- local group
|
||||
-- if isTourniquet then
|
||||
-- group = BodyLocations.getGroup("Human")
|
||||
-- group:setMultiItem(TourniquetController.bodyLoc, false)
|
||||
-- end
|
||||
|
||||
local ogValue = wrappedFunc(obj)
|
||||
|
||||
if isTourniquet then
|
||||
group:setMultiItem(TourniquetController.bodyLoc, true)
|
||||
end
|
||||
-- if isTourniquet then
|
||||
-- group:setMultiItem(TourniquetController.bodyLoc, true)
|
||||
-- end
|
||||
|
||||
return ogValue -- Needed for isValid
|
||||
end
|
||||
|
||||
@@ -167,15 +167,15 @@ function ISUnequipAction:perform()
|
||||
]]
|
||||
|
||||
local isProst = ProsthesisHandler.SearchAndSetupProsthesis(self.item, false)
|
||||
local group
|
||||
if isProst then
|
||||
group = BodyLocations.getGroup("Human")
|
||||
group:setMultiItem("TOC_ArmProst", false)
|
||||
end
|
||||
-- local group
|
||||
-- if isProst then
|
||||
-- group = BodyLocations.getGroup("Human")
|
||||
-- group:setMultiItem("TOC_ArmProst", false)
|
||||
-- end
|
||||
og_ISUnequipAction_perform(self)
|
||||
|
||||
if isProst then
|
||||
group:setMultiItem("TOC_ArmProst", true)
|
||||
-- group:setMultiItem("TOC_ArmProst", true)
|
||||
|
||||
-- we need to fetch the limbname associated to the prosthesis
|
||||
local side = CommonMethods.GetSide(self.item:getFullType())
|
||||
|
||||
Reference in New Issue
Block a user