From 5ab3ee722ecdfa848cf202b3ea4b152dd5072933 Mon Sep 17 00:00:00 2001 From: DrakiaXYZ Date: Wed, 20 Nov 2024 09:20:59 +0000 Subject: [PATCH] Fix issues caused when having NewSpawn enabled (!430) - When NewSpawn is active, clear spawn waves sent to the client - Copy `maxBotCap` to both BotMaxPvE and BotMax, as the client only reads BotMax These changes cause bots to abide by the NewSpawn parameters when NewSpawn is enabled, as previously it was combining bot waves and dynamic spawning resulting in bots instantly respawning Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com> Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/430 Co-authored-by: DrakiaXYZ Co-committed-by: DrakiaXYZ --- project/src/services/LocationLifecycleService.ts | 6 ++++++ project/src/services/PostDbLoadService.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/project/src/services/LocationLifecycleService.ts b/project/src/services/LocationLifecycleService.ts index 1d5ce6f1..988a0ca0 100644 --- a/project/src/services/LocationLifecycleService.ts +++ b/project/src/services/LocationLifecycleService.ts @@ -270,6 +270,12 @@ export class LocationLifecycleService { return locationBaseClone; } + // If new spawn system is enabled, clear the spawn waves + if (locationBaseClone.NewSpawn) + { + locationBaseClone.waves = []; + } + // We only need the base data if (!generateLoot) { return locationBaseClone; diff --git a/project/src/services/PostDbLoadService.ts b/project/src/services/PostDbLoadService.ts index 0b81e4ca..15b5b038 100644 --- a/project/src/services/PostDbLoadService.ts +++ b/project/src/services/PostDbLoadService.ts @@ -296,6 +296,7 @@ export class PostDbLoadService { } map.base.BotMaxPvE = this.botConfig.maxBotCap[locationKey]; + map.base.BotMax = this.botConfig.maxBotCap[locationKey]; // make values no larger than 30 secs map.base.BotStart = Math.min(map.base.BotStart, 30);