Basic Fix for traits
This commit is contained in:
@@ -4,6 +4,14 @@ function TocResetEverything()
|
|||||||
local player_inventory = player:getInventory()
|
local player_inventory = player:getInventory()
|
||||||
local mod_data = player:getModData()
|
local mod_data = player:getModData()
|
||||||
mod_data.TOC = nil
|
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)
|
TheOnlyCure.InitTheOnlyCure(_, player)
|
||||||
|
|
||||||
-- Destroy the amputation or prosthesis item
|
-- Destroy the amputation or prosthesis item
|
||||||
|
|||||||
@@ -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_operated = true
|
||||||
mod_data.TOC.Limbs.Left_LowerArm.is_amputation_shown = true
|
mod_data.TOC.Limbs.Left_LowerArm.is_amputation_shown = true
|
||||||
mod_data.TOC.Limbs.Left_LowerArm.is_cicatrized = 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
|
elseif player:HasTrait("Amputee_UpperArm") then
|
||||||
local amputation_clothing_item = player:getInventory():AddItem("TOC.Amputation_Left_UpperArm")
|
local amputation_clothing_item = player:getInventory():AddItem("TOC.Amputation_Left_UpperArm")
|
||||||
TocSetCorrectTextureForAmputation(amputation_clothing_item, player)
|
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_operated = true
|
||||||
mod_data.TOC.Limbs.Left_UpperArm.is_amputation_shown = true
|
mod_data.TOC.Limbs.Left_UpperArm.is_amputation_shown = true
|
||||||
mod_data.TOC.Limbs.Left_UpperArm.is_cicatrized = 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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user