Skip to content

Commit

Permalink
move UseDynamicAI to a method for easier reading.
Browse files Browse the repository at this point in the history
  • Loading branch information
DeadLeavez committed May 6, 2024
1 parent ea74f73 commit da79ec2
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Fika.Core/Coop/Players/CoopBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,26 +178,33 @@ protected override void Start()

WildSpawnType botType = Profile.Info.Settings.Role;

if( UseDynamicAI(botType) )
{
dynamicAi = gameObject.AddComponent<FikaDynamicAI>();
}
}

private bool UseDynamicAI( WildSpawnType botType)
{
if (botType == (WildSpawnType)FikaPlugin.sptUsecValue || botType == (WildSpawnType)FikaPlugin.sptBearValue)
{
if (FikaPlugin.DynamicAIPMC.Value)
{
dynamicAi = gameObject.AddComponent<FikaDynamicAI>();
return true;
}
return;
}
else if (botType == WildSpawnType.assault)
{
if (FikaPlugin.DynamicAIScav.Value)
{
dynamicAi = gameObject.AddComponent<FikaDynamicAI>();
return true;
}
return;
}
else if (FikaPlugin.DynamicAIRest.Value)
{
dynamicAi = gameObject.AddComponent<FikaDynamicAI>();
return true;
}
return false;
}

public override void BtrInteraction()
Expand Down

0 comments on commit da79ec2

Please sign in to comment.