diff --git a/CLAUDE.md b/CLAUDE.md index bfd7f421f..c71b89f0d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -27,6 +27,7 @@ Pages that are not migrated yet are named `_index.astro` so Astro skips them. Mi - Always hoist values that take work to compute (a function call, math, a lookup, like `"A".charCodeAt(0)` or `1 - SCROLL_ZONE`) and don't change between iterations or calls out of loops and repeatedly called functions into a `const` above them. No exceptions. Plain literals (strings, numbers, selectors like `"[data-row]"`) cost nothing and stay inline. - A helper function used in only one place gets inlined there. Only extract a function once it has a second caller. - Assert data that is known to be present with `!` instead of `?.` or `?? 0`; crashing beats silently showing a plausible wrong value. Keep `?.` only where absence is real logic: `optional` proto fields (check the `.proto`), optional script effect fields, and lookups that can legitimately miss. +- An `if` whose body ends up on its own line (including when the formatter wraps the condition) gets curly braces. Only a body on the same line as the `if` stays brace-less. - Single-line comments use `//`, never `/** */`. Keep `/** */` for multi-line doc comments. ## JSX diff --git a/packages/core/src/streams/sc2.ts b/packages/core/src/streams/sc2.ts index ea455b6f2..57509e27b 100644 --- a/packages/core/src/streams/sc2.ts +++ b/packages/core/src/streams/sc2.ts @@ -273,7 +273,8 @@ export type Component = } | { "comp.typename": "MotionComponent"; - "motion.filepath": string; + // absent on some skins (Oth99_Relic_hull_skin) that only carry playback settings + "motion.filepath"?: string; "motion.playbackRate": number; "simpleMotion.repeatsCount": number; } diff --git a/packages/website/src/core/blitzkit/sc2Components.ts b/packages/website/src/core/blitzkit/sc2Components.ts index bdffa71f7..5df75b9d3 100644 --- a/packages/website/src/core/blitzkit/sc2Components.ts +++ b/packages/website/src/core/blitzkit/sc2Components.ts @@ -127,7 +127,12 @@ export async function loadHierarchyMotions( parseHierarchies(sc2["#hierarchy"], null, (hierarchy, components) => { for (const component of components) { - if (component["comp.typename"] !== "MotionComponent") continue; + if ( + component["comp.typename"] !== "MotionComponent" || + component["motion.filepath"] === undefined + ) { + continue; + } loading.push( loadMotion(vfs, path, component).then((motion) => {