forked from OpenWF/SpaceNinjaServer
		
	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: OpenWF/SpaceNinjaServer#1106 Co-authored-by: Sainan <sainan@calamity.inc> Co-committed-by: Sainan <sainan@calamity.inc>
This commit is contained in:
		
							parent
							
								
									ec1f504bae
								
							
						
					
					
						commit
						457663f14a
					
				@ -95,16 +95,12 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) =
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        let InventoryChanges = {};
 | 
					        let InventoryChanges = {};
 | 
				
			||||||
        if (recipe.consumeOnUse) {
 | 
					        if (recipe.consumeOnUse) {
 | 
				
			||||||
            const recipeChanges = [
 | 
					            addRecipes(inventory, [
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    ItemType: pendingRecipe.ItemType,
 | 
					                    ItemType: pendingRecipe.ItemType,
 | 
				
			||||||
                    ItemCount: -1
 | 
					                    ItemCount: -1
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            ];
 | 
					            ]);
 | 
				
			||||||
 | 
					 | 
				
			||||||
            InventoryChanges = { ...InventoryChanges, Recipes: recipeChanges };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            addRecipes(inventory, recipeChanges);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (req.query.rush) {
 | 
					        if (req.query.rush) {
 | 
				
			||||||
            InventoryChanges = {
 | 
					            InventoryChanges = {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user