fixed setting correct texture for amputation

This commit is contained in:
Pao
2023-02-01 12:55:24 +01:00
parent af3f1cf23d
commit b3ce0ab2c4
14 changed files with 15 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ function TocSetCorrectTextureForAmputation(item, player, cicatrized)
local is_hairy = string.find(texture_string, "a$")
-- Hairy bodies
if is_hairy then
if is_hairy then
texture_string = texture_string:sub(1, -2) -- Removes b at the end to make it compatible
end
@@ -17,7 +17,11 @@ function TocSetCorrectTextureForAmputation(item, player, cicatrized)
if cicatrized then
matched_index = matched_index + 5 -- to use the cicatrized texture
if is_hairy then
matched_index = matched_index + 5 -- to use the cicatrized texture on hairy bodies
else
matched_index = matched_index + 10 -- cicatrized texture only, no hairs
end
end
print("TOC: Setting texture " .. matched_index)

View File

@@ -361,7 +361,7 @@ function TheOnlyCure.CutLimb(part_name, surgeon_factor, bandage_table, painkille
--Equip new model for amputation
local amputation_clothing_item = player:getInventory():AddItem(TocFindAmputatedClothingFromPartName(part_name))
TocSetCorrectTextureForAmputation(amputation_clothing_item, player)
TocSetCorrectTextureForAmputation(amputation_clothing_item, player, false)
player:setWornItem(amputation_clothing_item:getBodyLocation(), amputation_clothing_item)