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 <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
This commit is contained in:
DrakiaXYZ 2024-11-20 09:20:59 +00:00 committed by chomp
parent 9cf7a611bf
commit 5ab3ee722e
2 changed files with 7 additions and 0 deletions

View File

@ -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;

View File

@ -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);