返回提交历史
Modified
src/services/inventoryService.ts
+14
-1
XFEstudio/XFESpaceNinjaServer
fix: handle acquisition of modular weapon parts (#906)
Fixes #905 Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/906
d396fe8b
代码差异
1 个文件
+14
-1
@@ -322,7 +322,6 @@ export const addItem = async (
322
322
}
323
323
if (typeName in ExportWeapons) {
324
324
const weapon = ExportWeapons[typeName];
325
// Many non-weapon items are "Pistols" in Public Export, so some duck typing is needed.
326
325
if (weapon.totalDamage != 0) {
327
326
const inventoryChanges = addEquipment(inventory, weapon.productCategory, typeName);
328
327
updateSlots(inventory, InventorySlot.WEAPONS, 0, 1);
@@ -332,6 +331,20 @@ export const addItem = async (
332
331
WeaponBin: { count: 1, platinum: 0, Slots: -1 }
333
332
}
334
333
};
334
} else {
335
// Modular weapon parts
336
const miscItemChanges = [
337
{
338
ItemType: typeName,
339
ItemCount: quantity
340
} satisfies IMiscItem
341
];
342
addMiscItems(inventory, miscItemChanges);
343
return {
344
InventoryChanges: {
345
MiscItems: miscItemChanges
346
}
347
};
335
348
}
336
349
}
337
350
if (typeName in creditBundles) {