返回提交历史
Modified
src/services/inventoryService.ts
+21
-0
XFEstudio/XFESpaceNinjaServer
chore: cleanup skins with [object Object] (#3156)
The game will LogBug on this, which may cause it to crash. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3156 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
cb09ba8c
代码差异
1 个文件
+21
-0
@@ -2557,6 +2557,27 @@ export const cleanupInventory = async (inventory: TInventoryDatabaseDocument): P
2557
2557
if (inventory.LotusCustomization?.Skins) replaceSkinIds(inventory.LotusCustomization.Skins, weaponMap);
2558
2558
}
2559
2559
}
2560
2561
{
2562
let fixed = 0;
2563
for (const key of equipmentKeys) {
2564
for (const item of inventory[key]) {
2565
for (const config of item.Configs) {
2566
if (config.Skins) {
2567
for (let i = 0; i != config.Skins.length; ++i) {
2568
if (config.Skins[i] == "[object Object]") {
2569
config.Skins[i] = "";
2570
++fixed;
2571
}
2572
}
2573
}
2574
}
2575
}
2576
}
2577
if (fixed) {
2578
logger.debug(`fixed ${fixed} invalid skin upgrade ids`);
2579
}
2580
}
2560
2581
};
2561
2582
2562
2583
const collectSkins = (skins: string[], weaponMap: Map<string, string>, itemsToAdd: Set<string>): void => {