diff options
author | Dinorush <62536724+Dinorush@users.noreply.github.com> | 2022-02-15 01:25:19 -0500 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-02-15 23:43:40 +0100 |
commit | 5ba8ca77a30df0a9ffd78274fd09f34204e181d4 (patch) | |
tree | b7254560bf5c4093c4c688e22c477121ee9ff5d0 | |
parent | b08917da6e2cf01bfac6728b3f8bbcaf0ea64649 (diff) | |
download | NorthstarMods-5ba8ca77a30df0a9ffd78274fd09f34204e181d4.tar.gz NorthstarMods-5ba8ca77a30df0a9ffd78274fd09f34204e181d4.zip |
Check attacker validity JFS
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 23 |
1 files 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<int, bool> 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 |