mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-12 22:10:45 -05:00
Only add Z and follower to list if they dont exist already
Call `CheckAndAddEnemy` instead of `AddEnemy` - use additional checks
This commit is contained in:
parent
584215e2b4
commit
37e356c430
@ -7,6 +7,9 @@ namespace Aki.Custom.Patches
|
||||
{
|
||||
public class OfflineRaidSettingsMenuPatch : ModulePatch
|
||||
{
|
||||
/// <summary>
|
||||
/// RaidSettingsWindow.Show()
|
||||
/// </summary>
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
var desiredType = typeof(RaidSettingsWindow);
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user