From d518549711555f07ee556946ee700dcf3976e714 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 31 Aug 2024 20:35:39 +0100 Subject: [PATCH] Added early exit to `adjustLooseLootSpawnProbabilities()` --- project/src/controllers/GameController.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/project/src/controllers/GameController.ts b/project/src/controllers/GameController.ts index 6ba10227..04087bc5 100644 --- a/project/src/controllers/GameController.ts +++ b/project/src/controllers/GameController.ts @@ -400,8 +400,11 @@ export class GameController { } protected adjustLooseLootSpawnProbabilities(): void { - const adjustments = this.lootConfig.looseLootSpawnPointAdjustments; - for (const [mapId, mapAdjustments] of Object.entries(adjustments)) { + if (!this.lootConfig.looseLootSpawnPointAdjustments) { + return; + } + + for (const [mapId, mapAdjustments] of Object.entries(this.lootConfig.looseLootSpawnPointAdjustments)) { const mapLooseLootData = this.databaseService.getLocation(mapId).looseLoot; if (!mapLooseLootData) { this.logger.warning(this.localisationService.getText("location-map_has_no_loose_loot_data", mapId));