Fix organs spawning due to non-Vita-Saw damage

With this commit, organs only spawn when the weapon dealing damage is the Vita-Saw - not just when the Medic deals damage and is holding the Vita-Saw.
This commit is contained in:
Thomas Kain 2025-03-14 22:55:56 -04:00 committed by EricS-Valve
parent 65aa7c910e
commit ed11b204b2

View File

@ -9096,12 +9096,9 @@ int CTFPlayer::OnTakeDamage( const CTakeDamageInfo &inputInfo )
}
}
if ( pTFAttacker && pTFAttacker->IsPlayerClass( TF_CLASS_MEDIC ) )
if ( pTFAttacker && pTFAttacker->IsPlayerClass( TF_CLASS_MEDIC ) && pWeapon && pWeapon->GetWeaponID() == TF_WEAPON_BONESAW )
{
CTFWeaponBase *pAttackerWeapon = pTFAttacker->GetActiveTFWeapon();
if ( pAttackerWeapon && pAttackerWeapon->GetWeaponID() == TF_WEAPON_BONESAW )
{
CTFBonesaw *pBoneSaw = static_cast< CTFBonesaw* >( pAttackerWeapon );
CTFBonesaw *pBoneSaw = static_cast< CTFBonesaw* >( pWeapon );
if ( pBoneSaw->GetBonesawType() == BONESAW_UBER_SAVEDONDEATH )
{
// Spawn their spleen
@ -9136,7 +9133,6 @@ int CTFPlayer::OnTakeDamage( const CTakeDamageInfo &inputInfo )
}
}
}
}
if ( bIsSoldierRocketJumping || bIsDemomanPipeJumping )
{