From 9746621ea39635cb9f71488a8de9a71c061a2ebf Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Thu, 26 Mar 2020 12:52:12 -0400 Subject: [PATCH] Unknown asset attacker fix --- Classic/scripts/CTFGame.cs | 13 +++++++++---- Classic/scripts/SCtFGame.cs | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Classic/scripts/CTFGame.cs b/Classic/scripts/CTFGame.cs index 0837788..c9fc1c0 100644 --- a/Classic/scripts/CTFGame.cs +++ b/Classic/scripts/CTFGame.cs @@ -1556,10 +1556,15 @@ function CTFGame::awardScoreStaticShapeDestroy(%game, %cl, %obj) default: return; } - teamDestroyMessage(%cl, 'MsgDestroyed', %tMsg, %cl.name, %obj.nameTag); - messageClient(%cl, %msgType, %clMsg, %value, %dataName); - %game.recalcScore(%cl); - %game.shareScore(%scorer, %value); + if(isObject(%cl)) + { + teamDestroyMessage(%cl, 'MsgDestroyed', %tMsg, %cl.name, %obj.nameTag); + messageClient(%cl, %msgType, %clMsg, %value, %dataName); + %game.recalcScore(%cl); + %game.shareScore(%scorer, %value); + } + else //when the asset attacker is unknown + teamDestroyMessage(%cl, 'MsgDestroyed', %tMsg, "A teammate", %obj.nameTag); } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/Classic/scripts/SCtFGame.cs b/Classic/scripts/SCtFGame.cs index ad313fb..81a081d 100644 --- a/Classic/scripts/SCtFGame.cs +++ b/Classic/scripts/SCtFGame.cs @@ -1741,10 +1741,15 @@ function SCtFGame::awardScoreStaticShapeDestroy(%game, %cl, %obj) default: return; } - teamDestroyMessage(%cl, 'MsgDestroyed', %tMsg, %cl.name, %obj.nameTag); - messageClient(%cl, %msgType, %clMsg, %value, %dataName); - %game.recalcScore(%cl); - %game.shareScore(%scorer, %value); + if(isObject(%cl)) + { + teamDestroyMessage(%cl, 'MsgDestroyed', %tMsg, %cl.name, %obj.nameTag); + messageClient(%cl, %msgType, %clMsg, %value, %dataName); + %game.recalcScore(%cl); + %game.shareScore(%scorer, %value); + } + else //when the asset attacker is unknown + teamDestroyMessage(%cl, 'MsgDestroyed', %tMsg, "A teammate", %obj.nameTag); } /////////////////////////////////////////////////////////////////////////////////////////