Handle IsAlwaysSpawn in the same way we handle spawnpointsForced to allow single spawn restrictions (!231)

Also move the relaxation key single spawn limit to Streets instead of shoreline

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/231
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-02-18 09:03:37 +00:00 committed by chomp
parent 2e245d98ff
commit 97994fc0a6
2 changed files with 17 additions and 6 deletions

View File

@ -975,8 +975,7 @@
"64e74a4baac4cd0a7264ecdd"
],
"shoreline": [
"64e74a534d49d23b2c39d31b",
"6582dbf0b8d7830efc45016f"
"64e74a534d49d23b2c39d31b"
],
"tarkovstreets": [
"638df4cc7b560b03794a18d2",
@ -998,7 +997,8 @@
"64f07f7726cfa02c506f8ac0",
"64f69b4267e11a7c6206e010",
"64f5b4f71a5f313cb144c06c",
"657acb2ac900be5902191ac9"
"657acb2ac900be5902191ac9",
"6582dbf0b8d7830efc45016f"
],
"laboratory": [
"6398a4cfb5992f573c6562b3",

View File

@ -593,9 +593,14 @@ export class LocationGenerator
): SpawnpointTemplate[]
{
const loot: SpawnpointTemplate[] = [];
const dynamicForcedSpawnPoints: SpawnpointsForced[] = [];
// Add all forced loot to return array
this.addForcedLoot(loot, dynamicLootDist.spawnpointsForced, locationName);
// Build the list of forced loot from both `spawnpointsForced` and any point marked `IsAlwaysSpawn`
dynamicForcedSpawnPoints.push(...dynamicLootDist.spawnpointsForced);
dynamicForcedSpawnPoints.push(...dynamicLootDist.spawnpoints.filter(point => point.template.IsAlwaysSpawn));
// Add forced loot
this.addForcedLoot(loot, dynamicForcedSpawnPoints, locationName);
const allDynamicSpawnpoints = dynamicLootDist.spawnpoints;
@ -623,7 +628,13 @@ export class LocationGenerator
continue;
}
if (spawnpoint.probability === 1 || spawnpoint.template.IsAlwaysSpawn)
// We've handled IsAlwaysSpawn above, so skip them
if (spawnpoint.template.IsAlwaysSpawn)
{
continue;
}
if (spawnpoint.probability === 1)
{
guaranteedLoosePoints.push(spawnpoint);
continue;