mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 06:50:43 -05:00
Fixed errors
This commit is contained in:
parent
bcadacbd36
commit
9f6269f98b
@ -19,9 +19,9 @@ export class HideoutCustomisationGen {
|
||||
private achievementCustomisationReward: Record<string, IQuestReward[]> = {};
|
||||
|
||||
constructor(
|
||||
@injectAll("OnLoad") protected onLoadComponents: OnLoad[],
|
||||
@inject("DatabaseServer") protected databaseServer: DatabaseServer,
|
||||
@inject("PrimaryLogger") protected logger: ILogger,
|
||||
@injectAll("OnLoad") protected onLoadComponents: OnLoad[],
|
||||
) {}
|
||||
|
||||
async run(): Promise<void> {
|
||||
@ -99,7 +99,11 @@ export class HideoutCustomisationGen {
|
||||
// Build a dictionary of all quests with a `CustomizationDirect` reward
|
||||
private buildQuestCustomisationList(): void {
|
||||
for (const quest of Object.values(this.databaseServer.getTables().templates.quests)) {
|
||||
const allRewards: IQuestReward[] = Object.values(quest.rewards);
|
||||
const allRewards: IQuestReward[] = [
|
||||
...quest.rewards.Fail,
|
||||
...quest.rewards.Success,
|
||||
...quest.rewards.Started,
|
||||
];
|
||||
const customisationDirectRewards = allRewards.filter((reward) => reward.type === "CustomizationDirect");
|
||||
for (const directReward of customisationDirectRewards) {
|
||||
if (!this.questCustomisationReward[quest._id]) {
|
||||
|
@ -26,9 +26,10 @@ export class HideoutCustomisationProgram {
|
||||
Container.registerListTypes(childContainer);
|
||||
Container.registerPostLoadTypes(container, childContainer);
|
||||
|
||||
childContainer.resolve<HideoutCustomisationGen>("HideoutCustomisationGen").run();
|
||||
await childContainer.resolve<HideoutCustomisationGen>("HideoutCustomisationGen").run();
|
||||
} catch (err: unknown) {
|
||||
new ErrorHandler().handleCriticalError(err instanceof Error ? err : new Error(String(err)));
|
||||
console.log("HideoutCustomisationGen broke");
|
||||
//new ErrorHandler().handleCriticalError(err instanceof Error ? err : new Error(String(err)));
|
||||
}
|
||||
|
||||
// Kill the process, something holds it open so we need to manually kill it
|
||||
|
Loading…
x
Reference in New Issue
Block a user