返回提交历史
Modified
src/services/inventoryService.ts
+2
-17
XFEstudio/SpaceNinjaServer
chore: fix code duplication for Upgrades in addItems (#3525)
Closes #3521 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3525 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
7b29d2c6
代码差异
1 个文件
+2
-17
@@ -626,7 +626,8 @@ export const addItem = async (
626
626
if (
627
627
typeName in ExportUpgrades ||
628
628
typeName in ExportArcanes ||
629
typeName.startsWith("/Lotus/Upgrades/Mods/Fusers/") ||
629
typeName.startsWith("/Lotus/Upgrades/Mods/") || // Fusion Core, Legendary Core
630
typeName.startsWith("/Lotus/Upgrades/CosmeticEnhancers/") || // Traumatic Peculiar
630
631
(typeName.endsWith("AbilityCard") && typeName.startsWith("/Lotus/Powersuits/"))
631
632
) {
632
633
if (targetFingerprint && typeName.startsWith("/Lotus/Upgrades/Mods/Randomized/Raw")) {
@@ -933,22 +934,6 @@ export const addItem = async (
933
934
break;
934
935
case "Upgrades": {
935
936
switch (typeName.substring(1).split("/")[2]) {
936
case "Mods": // Legendary Core
937
case "CosmeticEnhancers": // Traumatic Peculiar
938
{
939
const changes = [
940
{
941
ItemType: typeName,
942
ItemCount: quantity
943
}
944
];
945
addMods(inventory, changes);
946
return {
947
RawUpgrades: changes
948
};
949
}
950
break;
951
952
937
case "Boons":
953
938
// Can purchase /Lotus/Upgrades/Boons/DuviriVendorBoonItem from Acrithis, doesn't need to be added to inventory.
954
939
logger.debug(`acquisition of ${typeName} is not committed to inventory`);