From 031089460eda53bd4af5e0b1bf7a0dfb7d41ef3e Mon Sep 17 00:00:00 2001 From: Dinorush <62536724+Dinorush@users.noreply.github.com> Date: Tue, 15 Feb 2022 01:25:19 -0500 Subject: Check attacker validity JFS --- .../mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut index 18684b05..b3f1c5cb 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -282,20 +282,21 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga int methodOfDeath = DamageInfo_GetDamageSourceIdentifier( damageInfo ) table alreadyAssisted - foreach( DamageHistoryStruct attackerInfo in player.e.recentDamageHistory ) + if ( IsValid( attacker ) ) { - if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == player ) - continue - - bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false - if( attackerInfo.attacker != attacker && !exists ) + foreach( DamageHistoryStruct attackerInfo in player.e.recentDamageHistory ) { - alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true - Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), player.GetEncodedEHandle(), attackerInfo.time ) - AddPlayerScore(attackerInfo.attacker, "PilotAssist" ) - } - + if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == player ) + continue + bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false + if( attackerInfo.attacker != attacker && !exists ) + { + alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true + Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), player.GetEncodedEHandle(), attackerInfo.time ) + AddPlayerScore(attackerInfo.attacker, "PilotAssist" ) + } + } } player.p.rematchOrigin = player.p.deathOrigin -- cgit v1.2.3