养成:修复消耗材料会显示空数据的情况
This commit is contained in:
@@ -103,9 +103,11 @@ export class HeroHandler {
|
|||||||
needExp -= dicGoods.value * _count;
|
needExp -= dicGoods.value * _count;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
material.push({ id, count });
|
if(count > 0) {
|
||||||
newExp += dicGoods.value * count;
|
material.push({ id, count });
|
||||||
needExp -= dicGoods.value * count;
|
newExp += dicGoods.value * count;
|
||||||
|
needExp -= dicGoods.value * count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user