diff --git a/Libraries/SPTarkov.Server.Core/Controllers/BotController.cs b/Libraries/SPTarkov.Server.Core/Controllers/BotController.cs index 7525b2a7..90397713 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/BotController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/BotController.cs @@ -39,6 +39,7 @@ public class BotController( { private readonly BotConfig _botConfig = _configServer.GetConfig(); private readonly PmcConfig _pmcConfig = _configServer.GetConfig(); + private static readonly Lock BotListLock = new(); /// /// Return the number of bot load-out varieties to be generated @@ -201,7 +202,10 @@ public class BotController( condition.Limit), // Choose largest between value passed in from request vs what's in bot.config _botHelper.IsBotPmc(condition.Role)); - result.AddRange(GenerateBotWave(condition, botWaveGenerationDetails, sessionId)); + lock (BotListLock) + { + result.AddRange(GenerateBotWave(condition, botWaveGenerationDetails, sessionId)); + } })).ToArray()); stopwatch.Stop();