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: use mongoose's 'id' function in addGearExpByCategory (#892)

Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/892

e46b3c7d
Sainan <sainan@calamity.inc>
提交于

代码差异

1 个文件 +2 -4
Modified src/services/inventoryService.ts +2 -4
@@ -823,12 +823,10 @@ export const addGearExpByCategory = (
823 823 return;
824 824 }
825 825
826 const itemIndex = ItemId ? category.findIndex(item => item._id?.equals(ItemId.$oid)) : -1;
827 if (itemIndex !== -1) {
828 const item = category[itemIndex];
826 const item = category.id(ItemId.$oid);
827 if (item) {
829 828 item.XP ??= 0;
830 829 item.XP += XP;
831 inventory.markModified(`${categoryName}.${itemIndex}.XP`);
832 830
833 831 const xpinfoIndex = inventory.XPInfo.findIndex(x => x.ItemType == item.ItemType);
834 832 if (xpinfoIndex !== -1) {