Added working tourniquet for left side

This commit is contained in:
Pao
2023-02-06 14:13:44 +01:00
parent 1545c88a19
commit 9633be4fc5
7 changed files with 111 additions and 12 deletions

View File

@@ -185,3 +185,30 @@ function ISInventoryPaneContextMenu.dropItem(item, player)
end
end
-- Make the player unable to equip a tourniquet on an already fully amputated limb
local og_ISWearClothingIsValid = ISWearClothing.isValid
function ISWearClothing:isValid()
local base_check = og_ISWearClothingIsValid(self)
--return self.character:getInventory():contains(self.item);
local item_full_type = self.item:getFullType()
-- TODO Sides
local limbs_data = self.character:getModData().TOC.Limbs
for _, side in pairs(TOC_sides) do
if string.find(item_full_type, "Test_Tourniquet_" .. side) then
if limbs_data[side .. "_UpperArm"].is_cut then
return false
end
end
end
return base_check
end