Skip to content

Commit 5ff88bc

Browse files
committed
gameplay: fix damage to MvM tank not giving crit bonus
missing TFPlayer specific damage reporting for crit bonus
1 parent da3c11c commit 5ff88bc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/game/server/tf/player_vs_environment/tf_base_boss.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,8 @@ int CTFBaseBoss::OnTakeDamage_Alive( const CTakeDamageInfo &rawInfo )
519519
gameeventmanager->FireEvent( event );
520520
}
521521

522+
int iPrevHealth = GetHealth();
523+
522524
int result = BaseClass::OnTakeDamage_Alive( info );
523525

524526
// emit injury outputs
@@ -570,6 +572,12 @@ int CTFBaseBoss::OnTakeDamage_Alive( const CTakeDamageInfo &rawInfo )
570572
pAttacker->OnDealtDamage( this, info );
571573

572574
CTF_GameStats.Event_BossDamage( pAttacker, info.GetDamage() );
575+
576+
// Give crit chance from damage
577+
if ( rawInfo.GetAttacker() != this )
578+
{
579+
pAttacker->RecordDamageEvent( info, GetHealth() <= 0, iPrevHealth );
580+
}
573581
}
574582

575583
return result;

0 commit comments

Comments
 (0)