From a7df0676bfc21eb9471aa4f486b0383b533a1317 Mon Sep 17 00:00:00 2001 From: x3Karma Date: Thu, 21 Jul 2022 08:30:10 +0800 Subject: Prevent crashing when an NPC titan kills a player or tries to earn score in Attrition (#425) * Small Fix towards Attrition * Update again after having more thoughts --- .../mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut index 9a94b8482..fae778d6d 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut @@ -78,6 +78,10 @@ void function HandleScoreEvent( entity victim, entity attacker, var damageInfo ) // Hacked spectre filter if ( victim.GetOwner() == attacker ) return + + // NPC titans without an owner player will not count towards any team's score + if ( attacker.IsNPC() && attacker.IsTitan() && !IsValid( GetPetTitanOwner( attacker ) ) ) + return // Split score so we can check if we are over the score max // without showing the wrong value on client @@ -507,4 +511,4 @@ void function AITdm_CleanupBoredNPCThread( entity guy ) print( "cleaning up bored npc: " + guy + " from team " + guy.GetTeam() ) guy.Destroy() -} \ No newline at end of file +} -- cgit v1.2.3