fix: relay wear amputation

This commit is contained in:
ZioPao
2026-01-31 17:21:10 +01:00
parent e129b325e4
commit 1d21c0d51c
3 changed files with 18 additions and 6 deletions

View File

@@ -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)

View File

@@ -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