From cca41c857da003aa31aa43feec090c1f0c4381e2 Mon Sep 17 00:00:00 2001 From: alt4 Date: Thu, 27 Jan 2022 14:32:32 +0100 Subject: Check if flag is still valid before looping --- .../mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut index dc976059..fa6643ab 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut @@ -334,7 +334,7 @@ void function DropFlagIfPhased( entity player, entity flag ) DropFlag( player, true ) }) - while( flag.GetParent() == player ) + while( IsValid( flag ) && flag.GetParent() == player ) WaitFrame() } @@ -519,4 +519,4 @@ void function TryReturnFlag( entity player, entity flag ) MessageToTeam( GetOtherTeam( flag.GetTeam() ), eEventNotifications.PlayerReturnedEnemyFlag, null, player ) EmitSoundOnEntityToTeam( flag, "UI_CTF_3P_EnemyReturnsFlag", GetOtherTeam( flag.GetTeam() ) ) PlayFactionDialogueToTeam( "ctf_flagReturnedEnemy", GetOtherTeam( flag.GetTeam() ) ) -} \ No newline at end of file +} -- cgit v1.2.3