aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers
diff options
context:
space:
mode:
authorDinorush <onparnorthstar@gmail.com>2022-02-14 21:24:26 -0500
committerBarichello <artur@barichello.me>2022-02-15 19:24:33 -0300
commitf00a45cc99113f2fe412284a17637039b735b3f7 (patch)
tree35b1546dd63eb2921f16e8c6fa83fef690ca6820 /Northstar.CustomServers
parentbca681c6e7b2b281a234d1ee9cbd671f97e45cb6 (diff)
downloadNorthstarMods-f00a45cc99113f2fe412284a17637039b735b3f7.tar.gz
NorthstarMods-f00a45cc99113f2fe412284a17637039b735b3f7.zip
Fix non-player and invalid ent assist crashes + self-assists
Diffstat (limited to 'Northstar.CustomServers')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut3
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut3
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut3
3 files changed, 9 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
index a3ea51725..962549b4d 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
@@ -16,6 +16,9 @@ void function GiveScoreForPlayerKill( entity victim, entity attacker, var damage
table<int, bool> alreadyAssisted
foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory )
{
+ if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == victim )
+ continue
+
bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false
if( attackerInfo.attacker != attacker && !exists )
{
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 feca3bd52..18684b05e 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
@@ -284,6 +284,9 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga
table<int, bool> alreadyAssisted
foreach( DamageHistoryStruct attackerInfo in player.e.recentDamageHistory )
{
+ 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 )
{
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
index b7fd4d520..36862d8a2 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
@@ -194,6 +194,9 @@ void function ScoreEvent_TitanKilled( entity victim, entity attacker, var damage
table<int, bool> alreadyAssisted
foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory )
{
+ if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == victim )
+ continue
+
bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false
if( attackerInfo.attacker != attacker && !exists )
{