Skip to content

Commit

Permalink
Prevent accessing deleted bots
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamLearns committed Sep 2, 2024
1 parent 1e52251 commit fba4b44
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions JumpRoyale/src/Arena.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ private async Task MakeBotsAutoJump(int y)

await ToSignal(GetTree().CreateTimer(2.0f), SceneTreeTimer.SignalName.Timeout);

// The game may have started since we last checked
if (_hasGameStarted)
{
return;
}

// Reset the bots to their original position
foreach (Jumper bot in _spawnedInstructionBots)
{
Expand Down

0 comments on commit fba4b44

Please sign in to comment.