From c563cc2c24362263b8f4e75ad213825d0373ce61 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Fri, 31 May 2024 08:50:13 +0200 Subject: [PATCH] Reduce amount of local variable assignments --- Fika.Core/Coop/Custom/FikaDynamicAI.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Fika.Core/Coop/Custom/FikaDynamicAI.cs b/Fika.Core/Coop/Custom/FikaDynamicAI.cs index 827c08cb..6379b07e 100644 --- a/Fika.Core/Coop/Custom/FikaDynamicAI.cs +++ b/Fika.Core/Coop/Custom/FikaDynamicAI.cs @@ -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) { @@ -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) {