返回提交历史
Modified
src/services/inventoryService.ts
+2
-4
XFEstudio/SpaceNinjaServer
chore: use mongoose's 'id' function in addGearExpByCategory (#892)
Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/892
e46b3c7d
代码差异
1 个文件
+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) {