Skip to content

Commit

Permalink
Add is IsValidPlayer() check
Browse files Browse the repository at this point in the history
to prevent potential script crash
  • Loading branch information
Zanieon committed Aug 30, 2024
1 parent ebbf9df commit 9e72cdc
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,11 @@ void function DropFlagIfPhased( entity player, entity flag )

OnThreadEnd( function() : ( player )
{
if (GetGameState() == eGameState.Playing || GetGameState() == eGameState.SuddenDeath)
DropFlag( player, true )
if ( IsValidPlayer( player ) )
{
if ( GetGameState() == eGameState.Playing || GetGameState() == eGameState.SuddenDeath )
DropFlag( player, true )
}
})
// the IsValid check is purely to prevent a crash due to a destroyed flag (epilogue)
while( IsValid(flag) && flag.GetParent() == player )
Expand Down

0 comments on commit 9e72cdc

Please sign in to comment.