properly remove config options
All checks were successful
Build / build (20) (push) Successful in 1m7s
Build / build (22) (push) Successful in 34s
Build / build (18) (push) Successful in 1m50s
Build / build (18) (pull_request) Successful in 1m7s
Build / build (22) (pull_request) Successful in 57s
Build / build (20) (pull_request) Successful in 36s

This commit is contained in:
Sainan 2025-02-19 01:36:39 +01:00
parent c0bf3a2db5
commit 06d2d94997
2 changed files with 3 additions and 6 deletions

View File

@ -39,8 +39,6 @@ interface IConfig {
skipAllDialogue?: boolean;
unlockAllScans?: boolean;
unlockAllMissions?: boolean;
unlockAllQuests?: boolean;
completeAllQuests?: boolean;
infiniteCredits?: boolean;
infinitePlatinum?: boolean;
infiniteEndo?: boolean;

View File

@ -3,7 +3,6 @@ import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/invento
import { IInventoryDatabase, IQuestKeyDatabase, IQuestStage } from "@/src/types/inventoryTypes/inventoryTypes";
import { logger } from "@/src/utils/logger";
import { HydratedDocument } from "mongoose";
import { config } from "@/src/services/configService";
export interface IUpdateQuestRequest {
QuestKeys: Omit<IQuestKeyDatabase, "CompletionDate">[];
@ -23,10 +22,10 @@ export const updateQuestKey = (
throw new Error("more than 1 quest key not supported");
}
let questKeyIndex = inventory.QuestKeys.findIndex(questKey => questKey.ItemType === questKeyUpdate[0].ItemType);
const questKeyIndex = inventory.QuestKeys.findIndex(questKey => questKey.ItemType === questKeyUpdate[0].ItemType);
if (questKeyIndex === -1) {
if (!config.unlockAllQuests) throw new Error(`quest key ${questKeyUpdate[0].ItemType} not found`);
questKeyIndex = inventory.QuestKeys.push({ ItemType: questKeyUpdate[0].ItemType }) - 1;
throw new Error(`quest key ${questKeyUpdate[0].ItemType} not found`);
}
inventory.QuestKeys[questKeyIndex] = questKeyUpdate[0];