Added early exit to adjustLooseLootSpawnProbabilities()

This commit is contained in:
Dev 2024-08-31 20:35:39 +01:00
parent f362f4eddc
commit d518549711

View File

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