This commit is contained in:
aozhiwei 2022-09-21 17:44:18 +08:00
parent 59b262fc3a
commit a4e3308d8b

View File

@ -140,14 +140,14 @@ class Fragment {
(element) => {
if (element == constant.SPEC_HERO_FRAGMENT) {
const allocedNum = data.get(element);
let remainNum = Math.floor(value.get('specHeroNum') / remainHour);
let remainNum = value.get('specHeroNum');
if (allocedNum) {
remainNum = Math.max(0, remainNum - allocedNum);
}
value.set(element, remainNum);
} else {
const allocedNum = data.get(element);
let remainNum = Math.floor(value.get('normalHeroNum') / remainHour);
let remainNum = value.get('normalHeroNum');
if (allocedNum) {
remainNum = Math.max(0, remainNum - allocedNum);
}
@ -160,14 +160,14 @@ class Fragment {
(element) => {
if (element == constant.SPEC_GUN_FRAGMENT) {
const allocedNum = data.get(element);
let remainNum = Math.floor(value.get('specGunNum') / remainHour);
let remainNum = value.get('specGunNum');
if (allocedNum) {
remainNum = Math.max(0, remainNum - allocedNum);
}
value.set(ITEM_PRE + element, remainNum);
} else {
const allocedNum = data.get(element);
let remainNum = Math.floor(value.get('normalGunNum') / remainHour);
let remainNum = value.get('normalGunNum');
if (allocedNum) {
remainNum = Math.max(0, remainNum - allocedNum);
}