From 9b66e3368b156cefc4bc67ea9786481659a90391 Mon Sep 17 00:00:00 2001 From: Made Baruna Date: Sat, 13 Aug 2022 16:36:01 +0700 Subject: [PATCH] Fix traveler geo calculator --- src/routes/calculator/_character.svelte | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/routes/calculator/_character.svelte b/src/routes/calculator/_character.svelte index ed4e50a9..14ace9f2 100644 --- a/src/routes/calculator/_character.svelte +++ b/src/routes/calculator/_character.svelte @@ -253,6 +253,8 @@ 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 commonMaterial = talent[j].commonMaterial.amount; const bossMaterial = talent[j].bossMaterial; @@ -269,13 +271,13 @@ talentMaterial.items[currentMaterial.id].amount += commonMaterial; if (bossMaterial > 0) { - if (talentMaterial.items[selectedCharacter.material.boss.id] === undefined) { - talentMaterial.items[selectedCharacter.material.boss.id] = { - ...selectedCharacter.material.boss, + if (talentMaterial.items[selectedCharacter[key].boss.id] === undefined) { + talentMaterial.items[selectedCharacter[key].boss.id] = { + ...selectedCharacter[key].boss, amount: 0, }; } - talentMaterial.items[selectedCharacter.material.boss.id].amount += bossMaterial; + talentMaterial.items[selectedCharacter[key].boss.id].amount += bossMaterial; } if (eventMaterial > 0) {