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: failure to remove shard installed via webui (#1129)

Fixes #1128 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1129

3af15881
Sainan <sainan@calamity.inc>
提交于

代码差异

1 个文件 +10 -9
Modified src/controllers/api/infestedFoundryController.ts +10 -9
@@ -57,17 +57,18 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
57 57 const inventory = await getInventory(accountId);
58 58 const suit = inventory.Suits.find(suit => suit._id.toString() == request.SuitId.$oid)!;
59 59
60 // refund shard
61 const shard = Object.entries(colorToShard).find(
62 ([color]) => color == suit.ArchonCrystalUpgrades![request.Slot].Color
63 )![1];
64 const miscItemChanges = [
65 {
60 const miscItemChanges: IMiscItem[] = [];
61 if (suit.ArchonCrystalUpgrades![request.Slot].Color) {
62 // refund shard
63 const shard = Object.entries(colorToShard).find(
64 ([color]) => color == suit.ArchonCrystalUpgrades![request.Slot].Color
65 )![1];
66 miscItemChanges.push({
66 67 ItemType: shard,
67 68 ItemCount: 1
68 }
69 ];
70 addMiscItems(inventory, miscItemChanges);
69 });
70 addMiscItems(inventory, miscItemChanges);
71 }
71 72
72 73 // remove from suit
73 74 suit.ArchonCrystalUpgrades![request.Slot] = {};