Skip to content

Commit

Permalink
Prevent client side crash in MFD when marked target dies out of bound…
Browse files Browse the repository at this point in the history
  • Loading branch information
ASpoonPlaysGames authored Jan 21, 2024
1 parent 0e5bf9e commit 7edb0f2
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,15 @@ void function UpdateMarksForKill( entity victim, entity attacker, var damageInfo
{
if ( victim == GetMarked( victim.GetTeam() ) )
{
MessageToAll( eEventNotifications.MarkedForDeathKill, null, victim, attacker.GetEncodedEHandle() )
// handle suicides. Not sure what the actual message is that vanilla shows for this
// but this will prevent crashing for now
bool isSuicide = IsSuicide( victim, attacker, DamageInfo_GetDamageSourceIdentifier( damageInfo ) )
entity actualAttacker = isSuicide ? victim : attacker

MessageToAll( eEventNotifications.MarkedForDeathKill, null, victim, actualAttacker.GetEncodedEHandle() )
svGlobal.levelEnt.Signal( "MarkKilled", { mark = victim } )
if ( attacker.IsPlayer() )

if ( !isSuicide && attacker.IsPlayer() )
attacker.SetPlayerGameStat( PGS_ASSAULT_SCORE, attacker.GetPlayerGameStat( PGS_ASSAULT_SCORE ) + 1 )
}
}

0 comments on commit 7edb0f2

Please sign in to comment.