Skip to content

Commit

Permalink
Recalculate connected peers every cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Oct 18, 2024
1 parent 94f6f47 commit 4e13a68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Fika.Core/Coop/GameMode/CoopGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,8 @@ private async Task WaitForPlayersToLoadBotProfile(int netId)
{
botQueue.Add(netId, 0);
DateTime start = DateTime.Now;
int connectedPeers = Singleton<FikaServer>.Instance.NetServer.ConnectedPeersCount;
FikaServer server = Singleton<FikaServer>.Instance;
int connectedPeers = server.NetServer.ConnectedPeersCount;

while (botQueue[netId] < connectedPeers)
{
Expand All @@ -586,6 +587,7 @@ private async Task WaitForPlayersToLoadBotProfile(int netId)
}

await Task.Delay(250);
connectedPeers = server.NetServer.ConnectedPeersCount;
}

botQueue.Remove(netId);
Expand Down

0 comments on commit 4e13a68

Please sign in to comment.