Fix traveler geo calculator

This commit is contained in:
Made Baruna 2022-08-13 16:36:01 +07:00
parent d755abc5ad
commit 9b66e3368b

View file

@ -253,6 +253,8 @@
currentMaterial = selectedCharacter.material_atk.material[j]; currentMaterial = selectedCharacter.material_atk.material[j];
} }
const key = selectedCharacter.id === characters.traveler_geo.id && i === 'first' ? 'material_atk' : 'material';
const bookAmount = talent[j].book.amount; const bookAmount = talent[j].book.amount;
const commonMaterial = talent[j].commonMaterial.amount; const commonMaterial = talent[j].commonMaterial.amount;
const bossMaterial = talent[j].bossMaterial; const bossMaterial = talent[j].bossMaterial;
@ -269,13 +271,13 @@
talentMaterial.items[currentMaterial.id].amount += commonMaterial; talentMaterial.items[currentMaterial.id].amount += commonMaterial;
if (bossMaterial > 0) { if (bossMaterial > 0) {
if (talentMaterial.items[selectedCharacter.material.boss.id] === undefined) { if (talentMaterial.items[selectedCharacter[key].boss.id] === undefined) {
talentMaterial.items[selectedCharacter.material.boss.id] = { talentMaterial.items[selectedCharacter[key].boss.id] = {
...selectedCharacter.material.boss, ...selectedCharacter[key].boss,
amount: 0, amount: 0,
}; };
} }
talentMaterial.items[selectedCharacter.material.boss.id].amount += bossMaterial; talentMaterial.items[selectedCharacter[key].boss.id].amount += bossMaterial;
} }
if (eventMaterial > 0) { if (eventMaterial > 0) {