From 380f0662a407f33b38f42c57d1949d8eb2202851 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Tue, 15 Apr 2025 06:16:07 -0700 Subject: [PATCH] fix: don't try to subtract MiscItems for polarity swap (#1633) Closes #1620 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1633 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/controllers/api/upgradesController.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/controllers/api/upgradesController.ts b/src/controllers/api/upgradesController.ts index 855d2aa7..2a376b4a 100644 --- a/src/controllers/api/upgradesController.ts +++ b/src/controllers/api/upgradesController.ts @@ -25,7 +25,13 @@ export const upgradesController: RequestHandler = async (req, res) => { operation.UpgradeRequirement == "/Lotus/Types/Items/MiscItems/CustomizationSlotUnlocker" ) { updateCurrency(inventory, 10, true); - } else if (operation.OperationType != "UOT_ABILITY_OVERRIDE") { + } 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,