mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-10 11:16:10 +01:00
Fix: Hide unused states of legendary camouflage parts (fixes maus)
This commit is contained in:
1 parent
0632899ecf
commit
682f039c6c
4 files changed
+20
-8
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
CamouflageDefinitions,
|
||||
camouflagePreset,
|
||||
Sc2ReadStream,
|
||||
type TankParameters,
|
||||
} from "@blitzkit/core";
|
||||
@@ -88,10 +89,7 @@ export abstract class ServerBlitzKitAPI2 extends ServerBlitzKitAPI1 {
|
||||
);
|
||||
|
||||
const [nation, tankKey] = vehicle.split(":");
|
||||
// some unique camos only set the preset for their one tank
|
||||
const preset =
|
||||
yamlEntry.preset ??
|
||||
yamlEntry.override?.[nation]?.override?.[tankKey]?.preset;
|
||||
const preset = camouflagePreset(yamlEntry, nation, tankKey);
|
||||
let hasPreset = false;
|
||||
|
||||
if (preset !== undefined) {
|
||||
|
||||
@@ -12,3 +12,15 @@ 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
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user