Skip to content

Commit

Permalink
Refactor GetPMCWildSpawnType & GetPmcSide
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchangelWTF committed Jul 18, 2024
1 parent 7b71257 commit 7ab0659
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions Bots/ProfilePreparationComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,32 +307,28 @@ private async UniTask InitializeBotInfos(StartingBotConfig startingBotConfig, st

private WildSpawnType GetPMCWildSpawnType(WildSpawnType sptUsec, WildSpawnType sptBear)
{
if (DefaultPluginVars.pmcFaction.Value == "Default")
switch(DefaultPluginVars.pmcFaction.Value)
{
return BotSpawn.DeterminePMCFactionBasedOnRatio(sptUsec, sptBear);
}
else if (DefaultPluginVars.pmcFaction.Value == "USEC")
{
return WildSpawnType.pmcUSEC;
}
else if (DefaultPluginVars.pmcFaction.Value == "BEAR")
{
return WildSpawnType.pmcBEAR;
case "USEC":
return WildSpawnType.pmcUSEC;
case "BEAR":
return WildSpawnType.pmcBEAR;
default:
return BotSpawn.DeterminePMCFactionBasedOnRatio(sptUsec, sptBear);
}
return BotSpawn.DeterminePMCFactionBasedOnRatio(sptUsec, sptBear);
}

private EPlayerSide GetPMCSide(WildSpawnType wildSpawnType, WildSpawnType sptUsec, WildSpawnType sptBear)
{
if (wildSpawnType == WildSpawnType.pmcUSEC)
{
return EPlayerSide.Usec;
}
else if (wildSpawnType == WildSpawnType.pmcBEAR)
switch(wildSpawnType)
{
return EPlayerSide.Bear;
case WildSpawnType.pmcUSEC:
return EPlayerSide.Usec;
case WildSpawnType.pmcBEAR:
return EPlayerSide.Bear;
default:
return EPlayerSide.Usec;
}
return EPlayerSide.Usec;
}

private List<BotDifficulty> GetDifficultiesForSetting(string difficultySetting)
Expand Down

0 comments on commit 7ab0659

Please sign in to comment.