From c56c7981d97f64bdf9afe3239ef3434278fd5578 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 23 Dec 2022 22:46:37 -0800 Subject: [PATCH] Extract the correct AX skills for display --- components/WeaponUnit/index.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/components/WeaponUnit/index.tsx b/components/WeaponUnit/index.tsx index 87cdc43c..52523ee5 100644 --- a/components/WeaponUnit/index.tsx +++ b/components/WeaponUnit/index.tsx @@ -123,8 +123,18 @@ const WeaponUnit = (props: Props) => { props.gridWeapon.ax ) { const axOptions = axData[props.gridWeapon.object.ax - 1] - const weaponAxSkill: SimpleAxSkill = props.gridWeapon.ax[index] - return axOptions.find((ax) => ax.id === weaponAxSkill.modifier) + const weaponAxSkill: SimpleAxSkill = props.gridWeapon.ax[0] + + let axSkill = axOptions.find((ax) => ax.id === weaponAxSkill.modifier) + + if (index !== 0 && axSkill && axSkill.secondary) { + const weaponSubAxSkill: SimpleAxSkill = props.gridWeapon.ax[1] + axSkill = axSkill.secondary.find( + (ax) => ax.id === weaponSubAxSkill.modifier + ) + } + + return axSkill } else return }