diff options
author | Dinorush <onparnorthstar@gmail.com> | 2022-02-14 21:24:26 -0500 |
---|---|---|
committer | Barichello <artur@barichello.me> | 2022-02-15 19:24:33 -0300 |
commit | f00a45cc99113f2fe412284a17637039b735b3f7 (patch) | |
tree | 35b1546dd63eb2921f16e8c6fa83fef690ca6820 /Northstar.Custom/mod | |
parent | bca681c6e7b2b281a234d1ee9cbd671f97e45cb6 (diff) | |
download | NorthstarMods-f00a45cc99113f2fe412284a17637039b735b3f7.tar.gz NorthstarMods-f00a45cc99113f2fe412284a17637039b735b3f7.zip |
Fix non-player and invalid ent assist crashes + self-assists
Diffstat (limited to 'Northstar.Custom/mod')
-rw-r--r-- | Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut index 4d3d6612..b27892f7 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut @@ -81,7 +81,10 @@ void function OnPlayerKilled( entity victim, entity attacker, var damageInfo ) table<int, bool> alreadyAssisted foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory ) { - if( attackerInfo.attacker != attacker && !( attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ) ) + if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == victim ) + continue + + if ( attackerInfo.attacker != attacker && !( attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ) ) { if ( attackerInfo.damageSourceId != eDamageSourceId.melee_pilot_emptyhanded ) { alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true |