From 253c5717a99c456e7c4e4c94a1be2cd8f6cc91df Mon Sep 17 00:00:00 2001 From: ZioPao Date: Sun, 13 Apr 2025 03:16:06 +0200 Subject: [PATCH] refactor: removed unused code --- 42/media/lua/client/TOC-42/Handlers/ProsthesisHandler.lua | 4 +--- common/media/lua/client/TOC/Compat.lua | 4 ++++ common/media/lua/client/TOC/Controllers/DataController.lua | 3 --- common/media/lua/server/TOC/ServerDataHandler.lua | 2 -- common/media/lua/shared/TOC/StaticData.lua | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/42/media/lua/client/TOC-42/Handlers/ProsthesisHandler.lua b/42/media/lua/client/TOC-42/Handlers/ProsthesisHandler.lua index 8e38b43..5de989d 100644 --- a/42/media/lua/client/TOC-42/Handlers/ProsthesisHandler.lua +++ b/42/media/lua/client/TOC-42/Handlers/ProsthesisHandler.lua @@ -1,9 +1,7 @@ local ProsthesisHandler = require("TOC/Handlers/ProsthesisHandler") -- declared in common local OverridenMethodsArchive = require("TOC/OverridenMethodsArchive") -local CommonMethods = require("TOC/CommonMethods") -local CachedDataHandler = require("TOC/Handlers/CachedDataHandler") --- FIX in B42 for some reason unequipping prosthesis doesn't work. Still not sure why + local og_ISClothingExtraAction_isValid = OverridenMethodsArchive.Get("ISClothingExtraAction_isValid") ---@diagnostic disable-next-line: duplicate-set-field diff --git a/common/media/lua/client/TOC/Compat.lua b/common/media/lua/client/TOC/Compat.lua index 45486e7..7f4150d 100644 --- a/common/media/lua/client/TOC/Compat.lua +++ b/common/media/lua/client/TOC/Compat.lua @@ -50,6 +50,10 @@ Compat.handlers = { ['iMedsFixed'] = { fun = Compat.iMeds, isActive = false} + + + + -- TODO Check if FirstAidOverhaul can be made compatible } diff --git a/common/media/lua/client/TOC/Controllers/DataController.lua b/common/media/lua/client/TOC/Controllers/DataController.lua index 65b621c..fba40cd 100644 --- a/common/media/lua/client/TOC/Controllers/DataController.lua +++ b/common/media/lua/client/TOC/Controllers/DataController.lua @@ -403,9 +403,6 @@ function DataController.ReceiveData(key, data) handler:setup(key) elseif data and data.limbs then -- Let's validate that the data structure is actually valid to prevent issues - if data.isUpdateFromServer then - TOC_DEBUG.print("Update from the server") - end handler:applyOnlineData(data) elseif username == getPlayer():getUsername() then TOC_DEBUG.print("Trying to load local data or no data is available") diff --git a/common/media/lua/server/TOC/ServerDataHandler.lua b/common/media/lua/server/TOC/ServerDataHandler.lua index b45aa92..39e678a 100644 --- a/common/media/lua/server/TOC/ServerDataHandler.lua +++ b/common/media/lua/server/TOC/ServerDataHandler.lua @@ -24,8 +24,6 @@ function ServerDataHandler.AddTable(key, table) --TOC_DEBUG.printTable(table) -- Set that the data has been modified and it's updated on the server - table.isUpdateFromServer = true -- FIX this is useless as of now - ModData.add(key, table) -- Add it to the server mod data ServerDataHandler.modData[key] = table diff --git a/common/media/lua/shared/TOC/StaticData.lua b/common/media/lua/shared/TOC/StaticData.lua index f9d2190..c1a15f5 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, isUpdateFromServer : boolean, isInitializing : boolean} +---@alias tocModDataType { limbs : limbsTable, prostheses : prosthesesTable, isIgnoredPartInfected : boolean, isAnyLimbCut : boolean, isInitializing : boolean} ---------------------------