Fixed huge mistake with hairy bodies
This commit is contained in:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user