From 162f1f69b31405cb53c572438d0e89d5da611af1 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Mon, 14 Apr 2025 19:26:57 +0200 Subject: [PATCH] nope, this doesn't work because UOT_ABILITY_OVERRIDE does have non-empty UpgradeRequirement (sometimes) --- src/controllers/api/upgradesController.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/controllers/api/upgradesController.ts b/src/controllers/api/upgradesController.ts index 8a0648b1..2a376b4a 100644 --- a/src/controllers/api/upgradesController.ts +++ b/src/controllers/api/upgradesController.ts @@ -25,16 +25,19 @@ export const upgradesController: RequestHandler = async (req, res) => { operation.UpgradeRequirement == "/Lotus/Types/Items/MiscItems/CustomizationSlotUnlocker" ) { updateCurrency(inventory, 10, true); - } else if (operation.UpgradeRequirement) { + } else if ( + operation.OperationType != "UOT_SWAP_POLARITY" && + operation.OperationType != "UOT_ABILITY_OVERRIDE" + ) { + if (!operation.UpgradeRequirement) { + throw new Error(`${operation.OperationType} operation should be free?`); + } addMiscItems(inventory, [ { ItemType: operation.UpgradeRequirement, ItemCount: -1 } satisfies IMiscItem ]); - } else { - // UOT_SWAP_POLARITY - free operation - // UOT_ABILITY_OVERRIDE - handled below } if (operation.OperationType == "UOT_ABILITY_OVERRIDE") {