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); } /////////////////////////////////////////////////////////////////////////////////////////