From 696edc1f1dac56fd92e24664ee05b064d61df602 Mon Sep 17 00:00:00 2001 From: ZioPao Date: Wed, 15 May 2024 11:47:28 +0200 Subject: [PATCH] Fixed wrong skin color for amputations --- media/lua/client/TOC/Controllers/ItemsController.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/media/lua/client/TOC/Controllers/ItemsController.lua b/media/lua/client/TOC/Controllers/ItemsController.lua index 7b81d88..f539e6c 100644 --- a/media/lua/client/TOC/Controllers/ItemsController.lua +++ b/media/lua/client/TOC/Controllers/ItemsController.lua @@ -21,7 +21,8 @@ function ItemsController.Player.GetAmputationTexturesIndex(playerObj, isCicatriz local textureString = playerObj:getHumanVisual():getSkinTexture() local isHairy = textureString:sub(-1) == "a" - local matchedIndex = tonumber(textureString:match("%d$")) or 0 + local matchedIndex = tonumber(textureString:match("%d%d")) -- it must always be at least 1 + TOC_DEBUG.print("Texture string: " .. tostring(textureString)) if isHairy then matchedIndex = matchedIndex + 5 @@ -31,7 +32,7 @@ function ItemsController.Player.GetAmputationTexturesIndex(playerObj, isCicatriz matchedIndex = matchedIndex + (isHairy and 5 or 10) -- We add 5 is it's the texture, else 10 end - TOC_DEBUG.print("isCicatrized= " .. tostring(isCicatrized)) + TOC_DEBUG.print("isCicatrized = " .. tostring(isCicatrized)) TOC_DEBUG.print("Amputation Texture Index: " .. tostring(matchedIndex)) return matchedIndex - 1 end