From ec1f504bae3d44a1dd4d853d17bd672687f18c4c Mon Sep 17 00:00:00 2001 From: Sainan Date: Sat, 8 Mar 2025 04:33:33 -0800 Subject: [PATCH] chore(webui): allow negative quantity for "add items" & "add mods" (#1113) Closes #1111 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1113 Co-authored-by: Sainan Co-committed-by: Sainan --- src/services/inventoryService.ts | 3 +++ static/webui/index.html | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index 9139d41c6..ccfaf0d04 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -284,6 +284,9 @@ export const addItem = async ( }; } else if (ExportResources[typeName].productCategory == "KubrowPetEggs") { const changes: IKubrowPetEggClient[] = []; + if (quantity < 0) { + throw new Error(`removal of KubrowPetEggs not handled`); + } for (let i = 0; i != quantity; ++i) { const egg: IKubrowPetEggDatabase = { ItemType: "/Lotus/Types/Game/KubrowPet/Eggs/KubrowEgg", diff --git a/static/webui/index.html b/static/webui/index.html index bb1c88dfe..f700994d7 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -89,7 +89,7 @@
- +
@@ -392,7 +392,7 @@
- +