Skip to content

Commit

Permalink
Improve DynamicAI disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed May 23, 2024
1 parent d3bfeb0 commit 848697e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Fika.Core/Coop/Custom/FikaDynamicAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Fika.Core.Coop.Components;
using Fika.Core.Coop.Players;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

namespace Fika.Core.Coop.Custom
Expand Down Expand Up @@ -193,9 +194,10 @@ public void EnabledChange(bool value)
{
if (!value)
{
foreach (CoopBot bot in disabledBots)
CoopBot[] disabledBotsArray = [.. disabledBots];
for (int i = 0; i < disabledBotsArray.Length; i++)
{
bot.gameObject.SetActive(true);
ActivateBot(disabledBotsArray[i]);
}

disabledBots.Clear();
Expand Down

0 comments on commit 848697e

Please sign in to comment.