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: unable to buy fish bait (#598)

c2a9fc66
Sainan <sainan@calamity.inc>
提交于

代码差异

1 个文件 +17 -15
Modified src/services/inventoryService.ts +17 -15
@@ -35,6 +35,7 @@ import {
35 35 ExportBoosterPacks,
36 36 ExportCustoms,
37 37 ExportFlavour,
38 ExportGear,
38 39 ExportRecipes,
39 40 ExportResources,
40 41 ExportUpgrades
@@ -186,6 +187,22 @@ export const addItem = async (
186 187 }
187 188 };
188 189 }
190 if (typeName in ExportGear) {
191 const inventory = await getInventory(accountId);
192 const consumablesChanges = [
193 {
194 ItemType: typeName,
195 ItemCount: quantity
196 } satisfies IConsumable
197 ];
198 addConsumables(inventory, consumablesChanges);
199 await inventory.save();
200 return {
201 InventoryChanges: {
202 Consumables: consumablesChanges
203 }
204 };
205 }
189 206
190 207 // Path-based duck typing
191 208 switch (typeName.substr(1).split("/")[1]) {
@@ -329,21 +346,6 @@ export const addItem = async (
329 346 };
330 347 }
331 348 break;
332 case "Restoratives": // Codex Scanner, Remote Observer, Starburst
333 const inventory = await getInventory(accountId);
334 const consumablesChanges = [
335 {
336 ItemType: typeName,
337 ItemCount: quantity
338 } satisfies IConsumable
339 ];
340 addConsumables(inventory, consumablesChanges);
341 await inventory.save();
342 return {
343 InventoryChanges: {
344 Consumables: consumablesChanges
345 }
346 };
347 349 }
348 350 break;
349 351 }