From 37e356c430228422fe405b5c8c60280a7cd23270 Mon Sep 17 00:00:00 2001 From: Dev Date: Sun, 30 Jul 2023 13:47:51 +0100 Subject: [PATCH] Only add Z and follower to list if they dont exist already Call `CheckAndAddEnemy` instead of `AddEnemy` - use additional checks --- project/Aki.Custom/Patches/OfflineRaidSettingsMenuPatch.cs | 3 +++ .../Models/Progression/LighthouseProgressionClass.cs | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/project/Aki.Custom/Patches/OfflineRaidSettingsMenuPatch.cs b/project/Aki.Custom/Patches/OfflineRaidSettingsMenuPatch.cs index eb8af81..ff1f43f 100644 --- a/project/Aki.Custom/Patches/OfflineRaidSettingsMenuPatch.cs +++ b/project/Aki.Custom/Patches/OfflineRaidSettingsMenuPatch.cs @@ -7,6 +7,9 @@ namespace Aki.Custom.Patches { public class OfflineRaidSettingsMenuPatch : ModulePatch { + /// + /// RaidSettingsWindow.Show() + /// protected override MethodBase GetTargetMethod() { var desiredType = typeof(RaidSettingsWindow); diff --git a/project/Aki.SinglePlayer/Models/Progression/LighthouseProgressionClass.cs b/project/Aki.SinglePlayer/Models/Progression/LighthouseProgressionClass.cs index 094fefc..65ca0cd 100644 --- a/project/Aki.SinglePlayer/Models/Progression/LighthouseProgressionClass.cs +++ b/project/Aki.SinglePlayer/Models/Progression/LighthouseProgressionClass.cs @@ -163,7 +163,10 @@ namespace Aki.SinglePlayer.Models.Progression }; // Save bot to list for later access - _zryachiyAndFollowers.Add(aiBot); + if (!_zryachiyAndFollowers.Contains(aiBot)) + { + _zryachiyAndFollowers.Add(aiBot); + } } } } @@ -176,7 +179,7 @@ namespace Aki.SinglePlayer.Models.Progression // If player is a scav, they must be added to the bosses enemy list otherwise they wont kill them foreach (var bot in _zryachiyAndFollowers) { - bot.AIData.BotOwner.BotsGroup.AddEnemy(_player); + bot.AIData.BotOwner.BotsGroup.CheckAndAddEnemy(_player); } // Flag player was added to enemy list