Fixed huge mistake with hairy bodies

This commit is contained in:
Pao
2023-01-31 23:00:15 +01:00
parent e13eee5aa5
commit 86a74915d5
6 changed files with 21 additions and 1 deletions

View File

@@ -1,6 +1,13 @@
function TocSetCorrectTextureForAmputation(item, player)
local human_visual = player:getHumanVisual()
local texture_string = human_visual:getSkinTexture()
-- Hairy bodies
if string.find(texture_string, "a$") then
texture_string = texture_string:sub(1, -2) -- Removes b at the end to make it compatible
end
local matched_index = string.match(texture_string, "%d$")
print("TOC: Setting texture " .. matched_index)
item:getVisual():setTextureChoice(tonumber(matched_index - 1)) -- TODO why is it correct with -1?