Compare commits

..

9 Commits

Author SHA1 Message Date
1ccca86801 lint
All checks were successful
Build / build (20) (push) Successful in 35s
Build / build (18) (push) Successful in 59s
Build / build (22) (push) Successful in 58s
Build / build (18) (pull_request) Successful in 36s
Build / build (20) (pull_request) Successful in 57s
Build / build (22) (pull_request) Successful in 1m1s
2025-02-19 01:28:11 +01:00
c35b764f4f Merge branch 'unlock-all-quests' of http://209.141.38.3/OpenWF/SpaceNinjaServer into unlock-all-quests
Some checks failed
Build / build (22) (push) Failing after 34s
Build / build (20) (push) Failing after 56s
Build / build (18) (push) Failing after 1m9s
Build / build (18) (pull_request) Failing after 36s
Build / build (20) (pull_request) Failing after 56s
Build / build (22) (pull_request) Failing after 58s
2025-02-19 01:26:19 +01:00
256a1ce3e7 add Progress 2025-02-19 01:26:05 +01:00
71ff93364d remove unused imports
All checks were successful
Build / build (18) (push) Successful in 35s
Build / build (22) (push) Successful in 56s
Build / build (20) (push) Successful in 1m9s
Build / build (18) (pull_request) Successful in 35s
Build / build (20) (pull_request) Successful in 56s
Build / build (22) (pull_request) Successful in 1m9s
2025-02-18 23:44:49 +01:00
9506c4876b update translations
Some checks failed
Build / build (20) (push) Failing after 32s
Build / build (18) (push) Failing after 56s
Build / build (22) (push) Failing after 1m11s
Build / build (18) (pull_request) Failing after 34s
Build / build (20) (pull_request) Failing after 54s
Build / build (22) (pull_request) Failing after 31s
2025-02-18 23:41:17 +01:00
9707db393b reset properly
Some checks failed
Build / build (20) (push) Failing after 33s
Build / build (22) (push) Failing after 55s
Build / build (18) (push) Failing after 1m10s
Build / build (18) (pull_request) Failing after 34s
Build / build (22) (pull_request) Failing after 1m9s
Build / build (20) (pull_request) Failing after 55s
2025-02-18 23:37:08 +01:00
b000032a95 fix
Some checks failed
Build / build (22) (push) Failing after 31s
Build / build (18) (push) Failing after 57s
Build / build (20) (pull_request) Failing after 57s
Build / build (20) (push) Failing after 1m2s
Build / build (18) (pull_request) Failing after 34s
Build / build (22) (pull_request) Failing after 1m1s
2025-02-18 23:34:06 +01:00
d81fdd24ed remove cheats
Some checks failed
Build / build (20) (push) Failing after 1m12s
Build / build (18) (push) Failing after 58s
Build / build (22) (push) Failing after 55s
Build / build (18) (pull_request) Failing after 35s
Build / build (22) (pull_request) Failing after 56s
Build / build (20) (pull_request) Failing after 1m10s
2025-02-18 22:39:37 +01:00
ecdd4ed06c stable 2025-02-18 22:31:24 +01:00

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];