aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod
diff options
context:
space:
mode:
authorDinorush <62536724+Dinorush@users.noreply.github.com>2022-02-15 01:25:19 -0500
committerBarichello <artur@barichello.me>2022-02-15 19:24:33 -0300
commit031089460eda53bd4af5e0b1bf7a0dfb7d41ef3e (patch)
tree55cdfa1b52e79fd9087434eb752db36c66426b55 /Northstar.CustomServers/mod
parentf00a45cc99113f2fe412284a17637039b735b3f7 (diff)
downloadNorthstarMods-031089460eda53bd4af5e0b1bf7a0dfb7d41ef3e.tar.gz
NorthstarMods-031089460eda53bd4af5e0b1bf7a0dfb7d41ef3e.zip
Check attacker validity JFS
Diffstat (limited to 'Northstar.CustomServers/mod')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut23
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