diff --git a/.vscode/settings.json b/.vscode/settings.json index a2e2a17..39267db 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,5 +19,9 @@ ".vscode", "dev_stuff", "workshop_files" + ], + "Lua.diagnostics.globals": [ + "FHSwapHandsAction", + "timer" ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 533f4fe..2df7b34 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -25,7 +25,7 @@ "label": "Bump Mod Version", "type": "shell", "options": {"statusbar": {"label": "$(arrow-up) Bump Mod Version"}}, - "command": "python ${config:zomboid_user_folder}/PaosCrap/bump_version.py 42/media/lua/client/TOC/Main.lua", + "command": "python ${config:zomboid_user_folder}/PaosCrap/bump_version.py common/media/lua/client/TOC/Main.lua", }, { "label": "Run Zomboid Debug No Steam (42)", diff --git a/common/media/lua/client/TOC/Controllers/TourniquetController.lua b/common/media/lua/client/TOC/Controllers/TourniquetController.lua index f66cc9c..23c226f 100644 --- a/common/media/lua/client/TOC/Controllers/TourniquetController.lua +++ b/common/media/lua/client/TOC/Controllers/TourniquetController.lua @@ -94,16 +94,19 @@ end local og_ISClothingExtraAction_perform = ISClothingExtraAction.perform +---@diagnostic disable-next-line: duplicate-set-field function ISClothingExtraAction:perform() TourniquetController.WrapClothingAction(self, og_ISClothingExtraAction_perform) end local og_ISWearClothing_isValid = ISWearClothing.isValid +---@diagnostic disable-next-line: duplicate-set-field function ISWearClothing:isValid() return TourniquetController.WrapClothingAction(self, og_ISWearClothing_isValid) end local og_ISUnequipAction_perform = ISUnequipAction.perform +---@diagnostic disable-next-line: duplicate-set-field function ISUnequipAction:perform() return TourniquetController.WrapClothingAction(self, og_ISUnequipAction_perform) end diff --git a/common/media/lua/client/TOC/Handlers/ProsthesisHandler.lua b/common/media/lua/client/TOC/Handlers/ProsthesisHandler.lua index 1787794..145b764 100644 --- a/common/media/lua/client/TOC/Handlers/ProsthesisHandler.lua +++ b/common/media/lua/client/TOC/Handlers/ProsthesisHandler.lua @@ -110,14 +110,15 @@ end --* Overrides *-- ----@diagnostic disable-next-line: duplicate-set-field local og_ISWearClothing_isValid = ISWearClothing.isValid +---@diagnostic disable-next-line: duplicate-set-field function ISWearClothing:isValid() local isEquippable = og_ISWearClothing_isValid(self) return ProsthesisHandler.Validate(self.item, isEquippable) end local og_ISWearClothing_perform = ISWearClothing.perform +---@diagnostic disable-next-line: duplicate-set-field function ISWearClothing:perform() ProsthesisHandler.SearchAndSetupProsthesis(self.item, true) og_ISWearClothing_perform(self) @@ -134,18 +135,26 @@ local og_ISClothingExtraAction_isValid = OverridenMethodsArchive.Save("ISClothin function ISClothingExtraAction:isValid() local isEquippable = og_ISClothingExtraAction_isValid(self) -- self.extra is a string, not the item + + -- B42 Compatibility to add local testItem = InventoryItemFactory.CreateItem(self.extra) return ProsthesisHandler.Validate(testItem, isEquippable) end local og_ISClothingExtraAction_perform = OverridenMethodsArchive.Save("ISClothingExtraAction_perform", ISClothingExtraAction.perform) +---@diagnostic disable-next-line: duplicate-set-field function ISClothingExtraAction:perform() + + + -- B42 Compatibility to add + local extraItem = InventoryItemFactory.CreateItem(self.extra) ProsthesisHandler.SearchAndSetupProsthesis(extraItem, true) og_ISClothingExtraAction_perform(self) end local og_ISUnequipAction_perform = ISUnequipAction.perform +---@diagnostic disable-next-line: duplicate-set-field function ISUnequipAction:perform() --[[ diff --git a/common/media/lua/client/TOC/TimedActions/CleanWoundAction.lua b/common/media/lua/client/TOC/TimedActions/CleanWoundAction.lua index 3d306c9..2ebfbea 100644 --- a/common/media/lua/client/TOC/TimedActions/CleanWoundAction.lua +++ b/common/media/lua/client/TOC/TimedActions/CleanWoundAction.lua @@ -7,6 +7,9 @@ local CommonMethods = require("TOC/CommonMethods") ---@field otherPlayer IsoPlayer ---@field bandage InventoryItem ---@field bodyPart any +---@field doctorLevel number +---@field bandagedPlayerX number +---@field bandagedPlayerY number local CleanWoundAction = ISBaseTimedAction:derive("CleanWoundAction") ---@param doctor IsoPlayer @@ -33,7 +36,7 @@ function CleanWoundAction:new(doctor, otherPlayer, bandage, bodyPart) if doctor:isTimedActionInstant() then o.maxTime = 1 end - if doctor:getAccessLevel() ~= "None" then -- TODO Fix for B42 + if doctor:getAccessLevel() ~= "None" then -- B42 Deprecated o.doctorLevel = 10 end return o