From 917d82c70749397e7226498d960f207d56aa7f6c Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Mon, 23 Jun 2025 22:20:36 +0200 Subject: [PATCH] combine conditions --- src/controllers/api/completeCalendarEventController.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/api/completeCalendarEventController.ts b/src/controllers/api/completeCalendarEventController.ts index 1f627a9e..993b55c7 100644 --- a/src/controllers/api/completeCalendarEventController.ts +++ b/src/controllers/api/completeCalendarEventController.ts @@ -14,10 +14,10 @@ export const completeCalendarEventController: RequestHandler = async (req, res) let inventoryChanges: IInventoryChanges = {}; const dayIndex = calendarProgress.SeasonProgress.LastCompletedDayIdx + 1; const day = currentSeason.Days[dayIndex]; - if (day.events.length != 0 && day.events[0].type == "CET_CHALLENGE") { - throw new Error(`completeCalendarEvent should not be used for challenges`); - } if (day.events.length != 0) { + if (day.events[0].type == "CET_CHALLENGE") { + throw new Error(`completeCalendarEvent should not be used for challenges`); + } const selection = day.events[parseInt(req.query.CompletedEventIdx as string)]; if (selection.type == "CET_REWARD") { inventoryChanges = (await handleStoreItemAcquisition(selection.reward!, inventory)).InventoryChanges;