From 21b5d2f2d8d34efab4dc9f8659fdf173f1d84c25 Mon Sep 17 00:00:00 2001 From: AzenKain Date: Sat, 10 Jan 2026 20:27:28 +0700 Subject: [PATCH] UPDATE: Fix bug --- src/components/monsterBar/ce.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/monsterBar/ce.tsx b/src/components/monsterBar/ce.tsx index 3a804b7..cb52c43 100644 --- a/src/components/monsterBar/ce.tsx +++ b/src/components/monsterBar/ce.tsx @@ -117,18 +117,18 @@ export default function CeBar() { if (!extraData || !extraData.theory_craft?.mode) return const newExtraData = structuredClone(extraData) - if (!newExtraData.theory_craft.hp) { - newExtraData.theory_craft.hp = {} + if (!newExtraData?.theory_craft?.hp) { + newExtraData.theory_craft!.hp = {} } for (let i = 0; i < ce_config.monsters.length; i++) { const waveKey = (i + 1).toString() - if (!newExtraData.theory_craft.hp[waveKey]) { - newExtraData.theory_craft.hp[waveKey] = [] + if (!newExtraData.theory_craft!.hp[waveKey]) { + newExtraData.theory_craft!.hp[waveKey] = [] } for (let j = 0; j < ce_config.monsters[i].length; j++) { - if (newExtraData.theory_craft.hp[waveKey][j] === undefined) { - newExtraData.theory_craft.hp[waveKey][j] = 0 + if (newExtraData.theory_craft!.hp[waveKey][j] === undefined) { + newExtraData.theory_craft!.hp[waveKey][j] = 0 } } } @@ -399,10 +399,10 @@ export default function CeBar() { const newData = structuredClone(extraData) if (!newData?.theory_craft?.hp?.[(waveIndex + 1).toString()]) { - newData.theory_craft.hp[(waveIndex + 1).toString()] = [] + newData.theory_craft!.hp![(waveIndex + 1).toString()] = [] } - newData.theory_craft.hp[(waveIndex + 1).toString()][memberIndex] = val + newData.theory_craft!.hp![(waveIndex + 1).toString()][memberIndex] = val setExtraData(newData) }}