Skip to content

Commit

Permalink
Reduce amount of local variable assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed May 31, 2024
1 parent 8714ba6 commit c563cc2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Fika.Core/Coop/Custom/FikaDynamicAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ private void CheckForPlayers(CoopBot bot)
}

int notInRange = 0;
float range = FikaPlugin.DynamicAIRange.Value;

foreach (CoopPlayer humanPlayer in humanPlayers)
foreach (CoopPlayer humanPlayer in humanPlayers)
{
if (humanPlayer == null)
{
Expand All @@ -173,8 +174,7 @@ private void CheckForPlayers(CoopBot bot)
continue;
}

float distance = Vector3.SqrMagnitude(bot.Position - humanPlayer.Position);
float range = FikaPlugin.DynamicAIRange.Value;
float distance = Vector3.SqrMagnitude(bot.Position - humanPlayer.Position);

if (distance > range * range)
{
Expand Down

0 comments on commit c563cc2

Please sign in to comment.