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

SpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/SpaceNinjaServer

chore: remove empty ModularParts arrays from equipment (#2565)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2565 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

522924a8
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +17 -1
Modified src/services/inventoryService.ts +17 -1
@@ -25,7 +25,8 @@ import {
25 25 INemesisWeaponTargetFingerprint,
26 26 INemesisPetTargetFingerprint,
27 27 IDialogueDatabase,
28 IKubrowPetPrintClient
28 IKubrowPetPrintClient,
29 equipmentKeys
29 30 } from "@/src/types/inventoryTypes/inventoryTypes";
30 31 import { IGenericUpdate, IUpdateNodeIntrosResponse } from "@/src/types/genericUpdate";
31 32 import { IKeyChainRequest, IMissionInventoryUpdateRequest } from "@/src/types/requestTypes";
@@ -2117,6 +2118,21 @@ export const cleanupInventory = (inventory: TInventoryDatabaseDocument): void =>
2117 2118 inventory.LotusCustomization.syancol = {};
2118 2119 }
2119 2120 }
2121
2122 {
2123 let numFixed = 0;
2124 for (const equipmentKey of equipmentKeys) {
2125 for (const item of inventory[equipmentKey]) {
2126 if (item.ModularParts?.length === 0) {
2127 item.ModularParts = undefined;
2128 ++numFixed;
2129 }
2130 }
2131 }
2132 if (numFixed != 0) {
2133 logger.debug(`removed ModularParts from ${numFixed} non-modular items`);
2134 }
2135 }
2120 2136 };
2121 2137
2122 2138 export const getDialogue = (inventory: TInventoryDatabaseDocument, dialogueName: string): IDialogueDatabase => {