Fix: Address review on animated legendary camouflages

- Inline the camouflage preset lookup instead of a one-off `camouflagePreset` helper
- Move the `primitive` override into the `jsxTree` mergers, so `skinTree` takes plain mergers and falls back to `<primitive>` like the mesh and group defaults
This commit is contained in:
Mark Greene committed 2026-11-05 17:26:56 +13:00
1 parent 2150fb3758
commit fddf407cc0
5 files changed
+15 -22

No files matched your search

@@ -1,6 +1,5 @@
import {
CamouflageDefinitions,
camouflagePreset,
Sc2ReadStream,
type TankParameters,
} from "@blitzkit/core";
@@ -89,7 +88,10 @@ export abstract class ServerBlitzKitAPI2 extends ServerBlitzKitAPI1 {
);
const [nation, tankKey] = vehicle.split(":");
const preset = camouflagePreset(yamlEntry, nation, tankKey);
// some unique camos only set the preset for their one tank
const preset =
yamlEntry.preset ??
yamlEntry.override?.[nation]?.override?.[tankKey]?.preset;
let hasPreset = false;
if (preset !== undefined) {
@@ -12,15 +12,3 @@ export type CamouflagesYaml = Record<
>;
}
>;
// some unique camos only set the preset for their one tank
export function camouflagePreset(
camouflage: CamouflagesYaml[string],
nation: string,
tankKey: string,
) {
return (
camouflage.preset ??
camouflage.override?.[nation]?.override?.[tankKey]?.preset
);
}