Extract the correct AX skills for display

This commit is contained in:
Justin Edmund 2022-12-23 22:46:37 -08:00
parent 4a87326307
commit c56c7981d9

View file

@ -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
}