XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

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 <sainan@calamity.inc> Co-committed-by: Sainan <sainan@calamity.inc>

457663f1
Sainan <sainan@calamity.inc>
提交于

代码差异

1 个文件 +2 -6
Modified src/controllers/api/claimCompletedRecipeController.ts +2 -6
@@ -95,16 +95,12 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) =
95 95
96 96 let InventoryChanges = {};
97 97 if (recipe.consumeOnUse) {
98 const recipeChanges = [
98 addRecipes(inventory, [
99 99 {
100 100 ItemType: pendingRecipe.ItemType,
101 101 ItemCount: -1
102 102 }
103 ];
104
105 InventoryChanges = { ...InventoryChanges, Recipes: recipeChanges };
106
107 addRecipes(inventory, recipeChanges);
103 ]);
108 104 }
109 105 if (req.query.rush) {
110 106 InventoryChanges = {