Skip to content

Commit

Permalink
Change spawn coroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed May 17, 2024
1 parent 237e077 commit 95e071c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Fika.Core/Coop/Players/CoopBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,18 +225,17 @@ private IEnumerator WaitForPlayersToLoadBot()
while (loadedPlayers < connectedPeers && start < 30f)
{
start += Time.deltaTime;
yield return new WaitForEndOfFrame();
yield return null;
}

Teleport(new Vector3(spawnPosition.x, spawnPosition.y + 1f, spawnPosition.z));
AIData.BotOwner.BotState = EBotState.PreActive;
IsStarted = true;
AIData.BotOwner.BotState = EBotState.PreActive;
float fallStart = 0f;

while (!MovementContext.IsGrounded || fallStart < 5f)
{
fallStart += Time.deltaTime;
yield return new WaitForEndOfFrame();
yield return null;
}

if (!MovementContext.IsGrounded)
Expand All @@ -249,6 +248,7 @@ private IEnumerator WaitForPlayersToLoadBot()
#endif
yield return new WaitForEndOfFrame();
ActiveHealthController.SetDamageCoeff(originalDamageCoeff);
IsStarted = true;
}

public override void OnDead(EDamageType damageType)
Expand Down

0 comments on commit 95e071c

Please sign in to comment.