From 5a7f03a2d45b0def12beb29cfc19c86738d7fa22 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 3 Oct 2024 15:17:00 +0100 Subject: [PATCH] Further refinement of loot generation code switch --- project/src/services/LocationLifecycleService.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/project/src/services/LocationLifecycleService.ts b/project/src/services/LocationLifecycleService.ts index 64fbe6c0..df684f31 100644 --- a/project/src/services/LocationLifecycleService.ts +++ b/project/src/services/LocationLifecycleService.ts @@ -96,7 +96,7 @@ export class LocationLifecycleService { serverId: `${request.location}.${request.playerSide}.${this.timeUtil.getTimestamp()}`, // TODO - does this need to be more verbose - investigate client? serverSettings: this.databaseService.getLocationServices(), // TODO - is this per map or global? profile: { insuredItems: playerProfile.InsuredItems }, - locationLoot: request.sptSkipLootGeneration ? null : this.generateLocationAndLoot(request.location), + locationLoot: this.generateLocationAndLoot(request.location, !request.sptSkipLootGeneration), transition: { isLocationTransition: false, transitionRaidId: "66f5750951530ca5ae09876d", @@ -227,9 +227,10 @@ export class LocationLifecycleService { /** * Generate a maps base location (cloned) and loot * @param name Map name + * @param generateLoot OPTIONAL - Should loot be generated for the map before being returned * @returns ILocationBase */ - protected generateLocationAndLoot(name: string): ILocationBase { + protected generateLocationAndLoot(name: string, generateLoot = true): ILocationBase { const location = this.databaseService.getLocation(name); const locationBaseClone = this.cloner.clone(location.base); @@ -241,6 +242,11 @@ export class LocationLifecycleService { return locationBaseClone; } + // We only need the base data + if (!generateLoot) { + return locationBaseClone; + } + // Check for a loot multipler adjustment in app context and apply if one is found let locationConfigClone: ILocationConfig; const raidAdjustments = this.applicationContext