temp fix
All checks were successful
Build / build (20) (push) Successful in 35s
Build / build (18) (push) Successful in 56s
Build / build (18) (pull_request) Successful in 36s
Build / build (22) (push) Successful in 1m27s
Build / build (20) (pull_request) Successful in 55s
Build / build (22) (pull_request) Successful in 34s
All checks were successful
Build / build (20) (push) Successful in 35s
Build / build (18) (push) Successful in 56s
Build / build (18) (pull_request) Successful in 36s
Build / build (22) (push) Successful in 1m27s
Build / build (20) (pull_request) Successful in 55s
Build / build (22) (pull_request) Successful in 34s
This commit is contained in:
parent
a03c987f69
commit
8332476f1c
@ -30,10 +30,11 @@ export const updateQuestController: RequestHandler = async (req, res) => {
|
||||
const questCompletionItems = getQuestCompletionItems(questKeyName);
|
||||
logger.debug(`quest completion items`, questCompletionItems);
|
||||
|
||||
const inventoryChanges = await addItems(inventory, questCompletionItems);
|
||||
if (questCompletionItems) {
|
||||
const inventoryChanges = await addItems(inventory, questCompletionItems);
|
||||
updateQuestResponse.InventoryChanges = inventoryChanges;
|
||||
}
|
||||
inventory.ActiveQuest = "";
|
||||
|
||||
updateQuestResponse.InventoryChanges = inventoryChanges;
|
||||
}
|
||||
|
||||
//TODO: might need to parse the custom data and add the associated items to inventory
|
||||
|
@ -189,11 +189,13 @@ export const getNode = (nodeName: string): IRegion => {
|
||||
};
|
||||
|
||||
export const getQuestCompletionItems = (questKey: string) => {
|
||||
const items = (questCompletionItems as unknown as Record<string, ITypeCount[] | undefined>)[questKey];
|
||||
if (!items) {
|
||||
throw new Error(`Quest ${questKey} not found in questCompletionItems`);
|
||||
}
|
||||
const items = (questCompletionItems as unknown as Record<string, ITypeCount[]> | undefined)?.[questKey];
|
||||
|
||||
if (!items) {
|
||||
logger.error(
|
||||
`Quest ${questKey} not found in questCompletionItems, quest completion items have not been given. This is a temporary solution`
|
||||
);
|
||||
}
|
||||
return items;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user