From 04c7172d8227f5362bc46c1abbed994c42b42e0e Mon Sep 17 00:00:00 2001 From: ZioPao Date: Mon, 14 Jul 2025 01:15:39 +0200 Subject: [PATCH] refactor: removed old code --- .../client/TOC/Controllers/DataController.lua | 20 ++++++------------- common/media/lua/shared/TOC/StaticData.lua | 2 +- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/common/media/lua/client/TOC/Controllers/DataController.lua b/common/media/lua/client/TOC/Controllers/DataController.lua index fba40cd..eb1314d 100644 --- a/common/media/lua/client/TOC/Controllers/DataController.lua +++ b/common/media/lua/client/TOC/Controllers/DataController.lua @@ -57,7 +57,6 @@ function DataController:setup(key) ---@type tocModDataType self.tocData = { -- Generic stuff that does not belong anywhere else - isInitializing = true, isIgnoredPartInfected = false, isAnyLimbCut = false, limbs = {}, @@ -93,10 +92,6 @@ function DataController:setup(key) -- Sync with the server self:apply() - -- -- Disable lock - -- self.tocData.isInitializing = false - -- ModData.add(key, self.tocData) - triggerEvent("OnSetupTocData") end @@ -339,14 +334,11 @@ end ---@param cicatrizationTime integer? function DataController:setLimbParams(limbName, ampStatus, cicatrizationTime) local limbData = self.tocData.limbs[limbName] - if ampStatus.isCut ~= nil then limbData.isCut = ampStatus.isCut end - if ampStatus.isInfected ~= nil then limbData.isInfected = ampStatus.isInfected end - if ampStatus.isOperated ~= nil then limbData.isOperated = ampStatus.isOperated end - if ampStatus.isCicatrized ~= nil then limbData.isCicatrized = ampStatus.isCicatrized end - if ampStatus.isCauterized ~= nil then limbData.isCauterized = ampStatus.isCauterized end - if ampStatus.woundDirtyness ~= nil then limbData.woundDirtyness = ampStatus.woundDirtyness end - if ampStatus.isVisible ~= nil then limbData.isVisible = ampStatus.isVisible end - + for k, v in pairs(ampStatus) do + if v ~= nil then + limbData[k] = v + end + end if cicatrizationTime ~= nil then limbData.cicatrizationTime = cicatrizationTime end end @@ -485,4 +477,4 @@ function DataController.DestroyInstance(username) end -return DataController \ No newline at end of file +return DataController diff --git a/common/media/lua/shared/TOC/StaticData.lua b/common/media/lua/shared/TOC/StaticData.lua index 833095f..152dbd7 100644 --- a/common/media/lua/shared/TOC/StaticData.lua +++ b/common/media/lua/shared/TOC/StaticData.lua @@ -2,7 +2,7 @@ ---@alias limbsTable {Hand_L : partDataType, ForeArm_L : partDataType, UpperArm_L : partDataType, Hand_R : partDataType, ForeArm_R : partDataType, UpperArm_R : partDataType } ---@alias prosthesisData {isProstEquipped : boolean, prostFactor : number } ---@alias prosthesesTable {Top_L : prosthesisData, Top_R : prosthesisData } -- TODO add Bottom_L and Bottom_R ----@alias tocModDataType { limbs : limbsTable, prostheses : prosthesesTable, isIgnoredPartInfected : boolean, isAnyLimbCut : boolean, isInitializing : boolean} +---@alias tocModDataType { limbs : limbsTable, prostheses : prosthesesTable, isIgnoredPartInfected : boolean, isAnyLimbCut : boolean} ---------------------------