diff --git a/src/app/tools/tankopedia/[id]/page.tsx b/src/app/tools/tankopedia/[id]/page.tsx index 0251a97c6..2a632f1ae 100644 --- a/src/app/tools/tankopedia/[id]/page.tsx +++ b/src/app/tools/tankopedia/[id]/page.tsx @@ -63,6 +63,8 @@ export default function Page({ params }: { params: { id: string } }) { }; }, [initialId, assigned]); + + return ( {assigned && ( diff --git a/src/components/Armor/components/ShotDisplay.tsx b/src/components/Armor/components/ShotDisplay.tsx index 3d6bc4611..c7a404a19 100644 --- a/src/components/Armor/components/ShotDisplay.tsx +++ b/src/components/Armor/components/ShotDisplay.tsx @@ -29,8 +29,8 @@ const layerTypeNames: Record = { }; const LENGTH_INFINITY = 4; -const TRACER_THIN = 1 / 128; const TRACER_THICK = 1 / 64; +const TRACER_THIN = TRACER_THICK / 2; export function ShotDisplay() { const shot = useTankopediaTemporary((state) => state.shot); @@ -53,12 +53,22 @@ export function ShotDisplay() { 0, shot.layers.indexOf(midPointLayer as ShotLayer), ); + const postMidPointLayers = shot?.layers.slice( + shot.layers.indexOf(midPointLayer as ShotLayer), + shot.layers.length, + ); const preMidPointGap = shot ? preMidPointLayers!.reduce((accumulator, layer) => { if (layer.type === null) return accumulator + layer.distance; return accumulator; }, 0) + LENGTH_INFINITY : undefined; + const postMidPointGap = shot + ? postMidPointLayers!.reduce((accumulator, layer) => { + if (layer.type === null) return accumulator + layer.distance; + return accumulator; + }, 0) || LENGTH_INFINITY + : undefined; useFrame(({ clock }) => { if (!shot || !preMidPointTracer.current) return; @@ -71,7 +81,7 @@ export function ShotDisplay() { if (!postMidPointTracer.current) return; - postMidPointTracer.current.position.set(0, t2 * preMidPointGap!, 0); + postMidPointTracer.current.position.set(0, t2 * postMidPointGap!, 0); postMidPointTracer.current.scale.set(1, 1 - 2 * Math.abs(t2 - 0.5), 1); }); @@ -114,15 +124,18 @@ export function ShotDisplay() { .multiplyScalar(-1), )} > - + - + diff --git a/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx b/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx index 426d17479..85ad7dcde 100644 --- a/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx +++ b/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx @@ -243,7 +243,6 @@ export function SpacedArmorSceneComponent({ thickness === 0 ? 0 : thickness / Math.cos(angle - finalNormalization); - remainingPenetration -= finalThickness; if (!threeCalibersRule && angle >= ricochet) { shot.layers.push({ @@ -279,7 +278,9 @@ export function SpacedArmorSceneComponent({ break; } else { + remainingPenetration -= finalThickness; const blocked = remainingPenetration < 0; + shot.layers.push({ type, index: layerIndex, @@ -299,6 +300,8 @@ export function SpacedArmorSceneComponent({ } } + console.log(shot); + useTankopediaTemporary.setState({ shot }); }, })}