Skip to content

Commit 3300848

Browse files
seanmcgeehanEricS-Valve
authored andcommitted
fix Short circuit for disguised spies
1 parent 0d557e6 commit 3300848

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/game/shared/tf/tf_item_wearable.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "tf_gamerules.h"
1111
#include "animation.h"
1212
#include "basecombatweapon_shared.h"
13+
#include "tf_weapon_mechanical_arm.h"
1314
#ifdef CLIENT_DLL
1415
#include "c_tf_player.h"
1516
#include "model_types.h"
@@ -578,6 +579,19 @@ bool CTFWearable::UpdateBodygroups( CBaseCombatCharacter* pOwner, int iState )
578579
{
579580
// We must use team 0 for disguise weapons.
580581
UpdateDisguiseBodygroups( pTFOwner, pDisguiseTarget, pItem, 0, iState );
582+
583+
CTFMechanicalArm* pMechArm = dynamic_cast<CTFMechanicalArm*>(pDisguiseWeapon);
584+
if (pMechArm) {
585+
// Hack, Short circuit is special case and should be off if it is the disguise weapon.
586+
// Directly set the bodygroup since UpdateDisguiseBodygroups doesn't work for this weapon
587+
int iDisguiseBody = pTFOwner->m_Shared.GetDisguiseBody();
588+
int iBodyGroup = pDisguiseTarget->FindBodygroupByName("rightarm");
589+
if (iBodyGroup != -1)
590+
{
591+
::SetBodygroup(pDisguiseTarget->GetModelPtr(), iDisguiseBody, iBodyGroup, 2);
592+
pTFOwner->m_Shared.SetDisguiseBody(iDisguiseBody);
593+
}
594+
}
581595
}
582596
}
583597

0 commit comments

Comments
 (0)