From 1d21c0d51c46c6c1b4abf4ad52753f6d4cdd7e0d Mon Sep 17 00:00:00 2001 From: ZioPao Date: Sat, 31 Jan 2026 17:21:10 +0100 Subject: [PATCH] fix: relay wear amputation --- .vscode/tasks.json | 15 +++++++++++++++ 42/media/lua/client/TOC/ClientRelayCommands.lua | 7 ++----- .../server/TOC/Controllers/ItemsController.lua | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 8537ffa..e422874 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -33,7 +33,22 @@ "problemMatcher": [ "$eslint-stylish" ] + }, + { + "label": "Run Zomboid Debug No Steam (42) - 2nd Instance", + "type": "shell", + "presentation": { + "group": "groupZomboid" + }, + "command": "\"${config:zomboid_folder_b42}\\ProjectZomboid64_Debug_NoSteam.bat\"", + "options": {"statusbar": {"label": "$(run) Zomboid client (42) - 2nd Instance"}}, + "problemMatcher": [ + "$eslint-stylish" + ] + + }, + // { // "label": "Run Zomboid Debug No Steam", // "type": "shell", diff --git a/42/media/lua/client/TOC/ClientRelayCommands.lua b/42/media/lua/client/TOC/ClientRelayCommands.lua index 52d3050..4b4b736 100644 --- a/42/media/lua/client/TOC/ClientRelayCommands.lua +++ b/42/media/lua/client/TOC/ClientRelayCommands.lua @@ -46,12 +46,9 @@ function ClientRelayCommands.ReceiveApplyFromServer() end ---* RELOAD MODEL *-- -function ClientRelayCommands.ReceiveReloadModel(args) - local texId = args.texId +--* WEAR AMPUTATION ITEM *-- +function ClientRelayCommands.ReceiveWearAmputation(args) local itemName = args.itemName - TOC_DEBUG.print("Resetting visuals locally for item " .. itemName .. " with texId " .. tostring(texId)) - local clothingItem = getPlayer():getInventory():FindAndReturn(itemName) getPlayer():setWornItem(clothingItem:getBodyLocation(), clothingItem) diff --git a/42/media/lua/server/TOC/Controllers/ItemsController.lua b/42/media/lua/server/TOC/Controllers/ItemsController.lua index 1692390..2a7555b 100644 --- a/42/media/lua/server/TOC/Controllers/ItemsController.lua +++ b/42/media/lua/server/TOC/Controllers/ItemsController.lua @@ -115,7 +115,7 @@ function ItemsController.Player.SpawnAmputationItem(playerObj, limbName) ---@cast clothingItem InventoryItem clothingItem:getVisual():setTextureChoice(texId) -- it counts from 0, so we have to subtract 1 sendAddItemToContainer(playerObj:getInventory(), clothingItem) - sendServerCommand(CommandsData.modules.TOC_RELAY, CommandsData.client.Relay.ReceiveWearAmputation, {itemName = itemName, texId = texId}) + sendServerCommand(playerObj, CommandsData.modules.TOC_RELAY, CommandsData.client.Relay.ReceiveWearAmputation, {itemName = itemName, texId = texId}) end ---Search through worn items and modifies a specific amputation item