养成:修复消耗材料会显示空数据的情况

This commit is contained in:
luying
2022-06-07 15:37:39 +08:00
parent a9b06b8156
commit 9d3041954d
@@ -103,11 +103,13 @@ export class HeroHandler {
needExp -= dicGoods.value * _count; needExp -= dicGoods.value * _count;
break; break;
} else { } else {
if(count > 0) {
material.push({ id, count }); material.push({ id, count });
newExp += dicGoods.value * count; newExp += dicGoods.value * count;
needExp -= dicGoods.value * count; needExp -= dicGoods.value * count;
} }
} }
}
if (newExp == oldExp) { if (newExp == oldExp) {
return resResult(STATUS.ROLE_EXP_NOT_ENOUGH); return resResult(STATUS.ROLE_EXP_NOT_ENOUGH);
@@ -599,7 +601,7 @@ export class HeroHandler {
if(!hero) return resResult(STATUS.HERO_NOT_FIND); if(!hero) return resResult(STATUS.HERO_NOT_FIND);
let consumes = hero.consumes||[]; let consumes = hero.consumes||[];
return resResult(STATUS.SUCCESS, { previewGoods: consumes }); return resResult(STATUS.SUCCESS, { previewGoods: consumes.filter(consume => consume.count > 0) });
} }
public async rebirth(msg: { hid: number }, session: BackendSession) { public async rebirth(msg: { hid: number }, session: BackendSession) {