From 3300848d8a25ef6403c91f82a4cd97d6daefbc06 Mon Sep 17 00:00:00 2001 From: senmcgen Date: Thu, 12 Mar 2026 19:15:11 -0400 Subject: [PATCH] fix Short circuit for disguised spies --- src/game/shared/tf/tf_item_wearable.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/game/shared/tf/tf_item_wearable.cpp b/src/game/shared/tf/tf_item_wearable.cpp index c50fad9fd..dcf7db00d 100644 --- a/src/game/shared/tf/tf_item_wearable.cpp +++ b/src/game/shared/tf/tf_item_wearable.cpp @@ -10,6 +10,7 @@ #include "tf_gamerules.h" #include "animation.h" #include "basecombatweapon_shared.h" +#include "tf_weapon_mechanical_arm.h" #ifdef CLIENT_DLL #include "c_tf_player.h" #include "model_types.h" @@ -578,6 +579,19 @@ bool CTFWearable::UpdateBodygroups( CBaseCombatCharacter* pOwner, int iState ) { // We must use team 0 for disguise weapons. UpdateDisguiseBodygroups( pTFOwner, pDisguiseTarget, pItem, 0, iState ); + + CTFMechanicalArm* pMechArm = dynamic_cast(pDisguiseWeapon); + if (pMechArm) { + // Hack, Short circuit is special case and should be off if it is the disguise weapon. + // Directly set the bodygroup since UpdateDisguiseBodygroups doesn't work for this weapon + int iDisguiseBody = pTFOwner->m_Shared.GetDisguiseBody(); + int iBodyGroup = pDisguiseTarget->FindBodygroupByName("rightarm"); + if (iBodyGroup != -1) + { + ::SetBodygroup(pDisguiseTarget->GetModelPtr(), iDisguiseBody, iBodyGroup, 2); + pTFOwner->m_Shared.SetDisguiseBody(iDisguiseBody); + } + } } }