diff --git a/Fika.Core/Coop/Players/CoopBot.cs b/Fika.Core/Coop/Players/CoopBot.cs index 262ad0ce..6bf86541 100644 --- a/Fika.Core/Coop/Players/CoopBot.cs +++ b/Fika.Core/Coop/Players/CoopBot.cs @@ -178,26 +178,33 @@ protected override void Start() WildSpawnType botType = Profile.Info.Settings.Role; + if( UseDynamicAI(botType) ) + { + dynamicAi = gameObject.AddComponent(); + } + } + + private bool UseDynamicAI( WildSpawnType botType) + { if (botType == (WildSpawnType)FikaPlugin.sptUsecValue || botType == (WildSpawnType)FikaPlugin.sptBearValue) { if (FikaPlugin.DynamicAIPMC.Value) { - dynamicAi = gameObject.AddComponent(); + return true; } - return; } else if (botType == WildSpawnType.assault) { if (FikaPlugin.DynamicAIScav.Value) { - dynamicAi = gameObject.AddComponent(); + return true; } - return; } else if (FikaPlugin.DynamicAIRest.Value) { - dynamicAi = gameObject.AddComponent(); + return true; } + return false; } public override void BtrInteraction()