fix
All checks were successful
Build / build (18) (push) Successful in 37s
Build / build (22) (push) Successful in 1m15s
Build / build (18) (pull_request) Successful in 35s
Build / build (20) (push) Successful in 57s
Build / build (20) (pull_request) Successful in 56s
Build / build (22) (pull_request) Successful in 1m14s

This commit is contained in:
Ordis 2025-02-19 22:25:06 +01:00
parent 229910cf2a
commit 59ad58a968
2 changed files with 22 additions and 6 deletions

View File

@ -39,7 +39,16 @@ export const manageQuestsController: RequestHandler = async (req, res) => {
case "completeAll": {
logger.info("completing all quests..");
for (const questKey of allQuestKeys) {
try {
await completeQuest(inventory, questKey);
} catch (error) {
if (error instanceof Error) {
logger.error(
`Something went wrong completing quest ${questKey}, probably could not add some item`
);
logger.error(error.message);
}
}
//Skip "Watch The Maker"
if (questKey === "/Lotus/Types/Keys/NewWarIntroQuest/NewWarIntroKeyChain") {
@ -70,7 +79,16 @@ export const manageQuestsController: RequestHandler = async (req, res) => {
logger.info("completing all unlocked quests..");
for (const questKey of inventory.QuestKeys) {
console.log("size of questkeys", inventory.QuestKeys.length);
try {
await completeQuest(inventory, questKey.ItemType);
} catch (error) {
if (error instanceof Error) {
logger.error(
`Something went wrong completing quest ${questKey.ItemType}, probably could not add some item`
);
logger.error(error.message);
}
}
//Skip "Watch The Maker"
if (questKey.ItemType === "/Lotus/Types/Keys/NewWarIntroQuest/NewWarIntroKeyChain") {

View File

@ -367,7 +367,7 @@ export const addItem = async (
};
}
if (typeName in ExportKeys) {
// Note: "/Lotus/Types/Keys/" contains some EmailItems and ShipFeatureItems
// Note: "/Lotus/Types/Keys/" contains some EmailItems
inventory.QuestKeys.push({ ItemType: typeName });
return {
InventoryChanges: {
@ -519,9 +519,7 @@ export const addItem = async (
}
break;
}
const errorMessage = `unable to add item: ${typeName}`;
logger.error(errorMessage);
return { InventoryChanges: { Error: [{ Error: errorMessage }] } };
throw new Error(`unable to add item: ${typeName}`);
};
export const addItems = async (