Basic Fix for traits

This commit is contained in:
Pao
2023-01-30 18:07:39 +01:00
parent da64bfc509
commit 18ceeb0cb5
2 changed files with 22 additions and 0 deletions

View File

@@ -4,6 +4,14 @@ function TocResetEverything()
local player_inventory = player:getInventory()
local mod_data = player:getModData()
mod_data.TOC = nil
-- Removes traits just to be sure
local toc_traits = player:getTraits()
toc_traits:remove("Amputee_Hand")
toc_traits:remove("Amputee_LowerArm")
toc_traits:remove("Amputee_UpperArm")
TheOnlyCure.InitTheOnlyCure(_, player)
-- Destroy the amputation or prosthesis item

View File

@@ -148,6 +148,13 @@ function TocSetInitData(mod_data, player)
mod_data.TOC.Limbs.Left_LowerArm.is_operated = true
mod_data.TOC.Limbs.Left_LowerArm.is_amputation_shown = true
mod_data.TOC.Limbs.Left_LowerArm.is_cicatrized = true
for _, v in pairs(mod_data.TOC.Limbs.Left_LowerArm.depends_on) do
mod_data.TOC.Limbs[v].is_cut = true
mod_data.TOC.Limbs[v].is_operated = true
mod_data.TOC.Limbs[v].is_amputation_shown = false
mod_data.TOC.Limbs[v].is_cicatrized = true
end
elseif player:HasTrait("Amputee_UpperArm") then
local amputation_clothing_item = player:getInventory():AddItem("TOC.Amputation_Left_UpperArm")
TocSetCorrectTextureForAmputation(amputation_clothing_item, player)
@@ -157,6 +164,13 @@ function TocSetInitData(mod_data, player)
mod_data.TOC.Limbs.Left_UpperArm.is_operated = true
mod_data.TOC.Limbs.Left_UpperArm.is_amputation_shown = true
mod_data.TOC.Limbs.Left_UpperArm.is_cicatrized = true
for _, v in pairs(mod_data.TOC.Limbs.Left_UpperArm.depends_on) do
mod_data.TOC.Limbs[v].is_cut = true
mod_data.TOC.Limbs[v].is_operated = true
mod_data.TOC.Limbs[v].is_amputation_shown = false
mod_data.TOC.Limbs[v].is_cicatrized = true
end
end