Added getMoneyTpls()

This commit is contained in:
Dev 2024-07-07 19:43:32 +01:00
parent 7497f0d40f
commit bda69a5563
2 changed files with 8 additions and 3 deletions

View File

@ -15,7 +15,6 @@ import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "@
import { Item } from "@spt/models/eft/common/tables/IItem";
import { BaseClasses } from "@spt/models/enums/BaseClasses";
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
import { Money } from "@spt/models/enums/Money";
import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer";
@ -424,9 +423,9 @@ export class LocationLootGenerator
.map((x) => x.itemTpl);
// Draw random loot
// Money spawn more than once in container
// Allow money to spawn more than once in container
let failedToFitCount = 0;
const locklist = [Money.ROUBLES, Money.DOLLARS, Money.EUROS, Money.GP];
const locklist = this.itemHelper.getMoneyTpls();
// Choose items to add to container, factor in weighting + lock money down
// Filter out items picked that're already in the above `tplsForced` array

View File

@ -8,6 +8,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { BaseClasses } from "@spt/models/enums/BaseClasses";
import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots";
import { ItemTpl } from "@spt/models/enums/ItemTpl";
import { Money } from "@spt/models/enums/Money";
import { ILogger } from "@spt/models/spt/utils/ILogger";
import { DatabaseService } from "@spt/services/DatabaseService";
import { ItemBaseClassService } from "@spt/services/ItemBaseClassService";
@ -1916,6 +1917,11 @@ export class ItemHelper
return false;
}
public getMoneyTpls(): string[]
{
return Object.values(Money);
}
}
// eslint-disable-next-line @typescript-eslint/no-namespace