From da0da8b0ab000d3281e7956c9d4049ad77451eb6 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 27 Jun 2024 15:18:44 +0100 Subject: [PATCH] Added assaultGroup check to isBoss code inside `CustomAiPatch` --- project/SPT.Custom/Patches/CustomAiPatch.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/project/SPT.Custom/Patches/CustomAiPatch.cs b/project/SPT.Custom/Patches/CustomAiPatch.cs index 07cd7ad..5aaec07 100644 --- a/project/SPT.Custom/Patches/CustomAiPatch.cs +++ b/project/SPT.Custom/Patches/CustomAiPatch.cs @@ -63,7 +63,8 @@ namespace SPT.Custom.Patches } // Is a boss bot and not already handled above - if (___botOwner_0.Profile.Info.Settings.IsBoss() + if (___botOwner_0.Profile.Info.Settings.IsBoss() + && !BotHasAssaultGroupRole(___botOwner_0) && !isPlayerScav && !isNormalAssaultScav && !isSptPmc) @@ -91,8 +92,8 @@ namespace SPT.Custom.Patches /// WildSpawnType private static WildSpawnType FixAssaultGroupPmcsRole(BotOwner botOwner) { - // Is PMC - if (botOwner.Profile.Info.IsStreamerModeAvailable && botOwner.Profile.Info.Settings.Role == WildSpawnType.assaultGroup) + // Is PMC + set to assaultGroup + if (botOwner.Profile.Info.IsStreamerModeAvailable && BotHasAssaultGroupRole(botOwner)) { Logger.LogError($"Broken PMC found: {botOwner.Profile.Nickname}, was {botOwner.Profile.Info.Settings.Role}"); @@ -106,6 +107,11 @@ namespace SPT.Custom.Patches return botOwner.Profile.Info.Settings.Role; } + private static bool BotHasAssaultGroupRole(BotOwner botOwner) + { + return botOwner.Profile.Info.Settings.Role == WildSpawnType.assaultGroup; + } + /// /// Revert prefix change, get bots type back to what it was before changes ///