From 457663f14a037f89f060e89ccfd57fc8818c0466 Mon Sep 17 00:00:00 2001 From: Sainan Date: Sat, 8 Mar 2025 04:33:45 -0800 Subject: [PATCH] fix: claim recipe response (#1106) Fixes #1105 The client already 'knows' the ItemCount was decremented so when we also say it in the response, it actually ends up causing the client to think the recipe was used twice. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1106 Co-authored-by: Sainan Co-committed-by: Sainan --- src/controllers/api/claimCompletedRecipeController.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/controllers/api/claimCompletedRecipeController.ts b/src/controllers/api/claimCompletedRecipeController.ts index 47d606bfc..325d10ff7 100644 --- a/src/controllers/api/claimCompletedRecipeController.ts +++ b/src/controllers/api/claimCompletedRecipeController.ts @@ -95,16 +95,12 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) = let InventoryChanges = {}; if (recipe.consumeOnUse) { - const recipeChanges = [ + addRecipes(inventory, [ { ItemType: pendingRecipe.ItemType, ItemCount: -1 } - ]; - - InventoryChanges = { ...InventoryChanges, Recipes: recipeChanges }; - - addRecipes(inventory, recipeChanges); + ]); } if (req.query.rush) { InventoryChanges = {