From 2f82021b5d1d264815a5af6a7ce17ddd48d6408f Mon Sep 17 00:00:00 2001 From: ZioPao Date: Sat, 13 Jul 2024 19:13:18 +0200 Subject: [PATCH] Fixed bandage\stitches action after amputation applying to wrong body part --- media/lua/client/TOC/Handlers/AmputationHandler.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/media/lua/client/TOC/Handlers/AmputationHandler.lua b/media/lua/client/TOC/Handlers/AmputationHandler.lua index 97a776a..837168f 100644 --- a/media/lua/client/TOC/Handlers/AmputationHandler.lua +++ b/media/lua/client/TOC/Handlers/AmputationHandler.lua @@ -89,9 +89,12 @@ end ---@param stitchesItem InventoryItem ---@return ISStitch function AmputationHandler.PrepareStitchesAction(prevAction, limbName, surgeonPl, patientPl, stitchesItem) - local bptEnum = StaticData.LIMBS_TO_BODYLOCS_IND_BPT[limbName] local bd = patientPl:getBodyDamage() - local bodyPart = bd:getBodyPart(bptEnum) + + -- we need the adjacent one, not the actual one + local adjacentLimb = StaticData.LIMBS_ADJACENT_IND_STR[limbName] + local bodyPart = bd:getBodyPart(BodyPartType[adjacentLimb]) + local stitchesAction = ISStitch:new(surgeonPl, patientPl, stitchesItem, bodyPart, true) ISTimedActionQueue.addAfter(prevAction, stitchesAction) @@ -106,9 +109,11 @@ end ---@param bandageItem InventoryItem ---@return ISApplyBandage function AmputationHandler.PrepareBandagesAction(prevAction, limbName, surgeonPl, patientPl, bandageItem) - local bptEnum = StaticData.LIMBS_TO_BODYLOCS_IND_BPT[limbName] local bd = patientPl:getBodyDamage() - local bodyPart = bd:getBodyPart(bptEnum) + -- we need the adjacent one, not the actual one + local adjacentLimb = StaticData.LIMBS_ADJACENT_IND_STR[limbName] + local bodyPart = bd:getBodyPart(BodyPartType[adjacentLimb]) + local bandageAction = ISApplyBandage:new(surgeonPl, patientPl, bandageItem, bodyPart, true) ISTimedActionQueue.addAfter(prevAction, bandageAction)