diff --git a/packages/website-ue/src/core/blitz/aggregateStages.ts b/packages/website-ue/src/core/blitz/aggregateStages.ts index 98456fb64..b70d8ad9a 100644 --- a/packages/website-ue/src/core/blitz/aggregateStages.ts +++ b/packages/website-ue/src/core/blitz/aggregateStages.ts @@ -28,23 +28,26 @@ function patch(stage0: StageParameters, stage1: StageParameters) { case TankAttributeChange_Modifier.MODIFIER_MULTIPLY: case TankAttributeChange_Modifier.MODIFIER_ADD: - if (!(attribute1.attribute_name in stage0)) { + const attribute0 = stage0.attributes.find( + (attribute0) => + attribute0.attribute_name === attribute1.attribute_name + ); + + if (!attribute0) { throw new Error( `Missing attribute ${ TankAttributeChange_AttributeName[attribute1.attribute_name] - } to modify` + } (${attribute1.attribute_name}) to modify` ); } - const oldValue = stage0.attributes[attribute1.attribute_name]!.value; - case TankAttributeChange_Modifier.MODIFIER_MULTIPLY: { - value1 = oldValue! * attribute1.value; + value1 = attribute0!.value! * attribute1.value; break; } case TankAttributeChange_Modifier.MODIFIER_ADD: { - value1 = oldValue! + attribute1.value; + value1 = attribute0!.value! + attribute1.value; break; } diff --git a/packages/website-ue/src/pages/tanks/[slug]/_index.tsx b/packages/website-ue/src/pages/tanks/[slug]/_index.tsx index 289577e01..da5afe99b 100644 --- a/packages/website-ue/src/pages/tanks/[slug]/_index.tsx +++ b/packages/website-ue/src/pages/tanks/[slug]/_index.tsx @@ -17,33 +17,33 @@ function Content({ id }: { id: string }) { const tank = useAwait(() => api.tank(id), `tank-${id}`); const stage = Tankopedia.use((state) => state.stage); - - const aggregatedStages = useMemo( + const parameters = useMemo( () => aggregateStages(tank.base_stats!, tank.upgrade_stages, stage), [stage] ); return ( <> -
-      

{tank.name?.value}

- -

Characteristics

-
{times(tank.upgrade_stages.length, (index) => ( ))}
+
+      

{tank.name?.value}

+ +

Characteristics

+ {/* {_characteristicsOrder.map((group) => ( <>

{CharacteristicsGroup[group.group]}