From 84f950ade4e9bfc05a3dce85f8239d6cecec3081 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 2 Sep 2026 16:32:46 -0500 Subject: [PATCH] fix tag0 assumption --- docs/changelogs/1.31.2.md | 3 +++ package.json | 2 +- .../src/blitzkit/api/server/1_tankDefinitions.ts | 13 ++++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 docs/changelogs/1.31.2.md diff --git a/docs/changelogs/1.31.2.md b/docs/changelogs/1.31.2.md new file mode 100644 index 000000000..991358786 --- /dev/null +++ b/docs/changelogs/1.31.2.md @@ -0,0 +1,3 @@ +# BlitzKit 1.31.2 + +This update fixes an issue that occurred with Wargaming chose to declare the class of a tank in the game code with a tag that isn't the first in the list. diff --git a/package.json b/package.json index 58a498833..f9457b0a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blitzkit", - "version": "1.31.1", + "version": "1.31.2", "license": "BlitzKit License", "private": true, "scripts": { diff --git a/packages/core/src/blitzkit/api/server/1_tankDefinitions.ts b/packages/core/src/blitzkit/api/server/1_tankDefinitions.ts index 9269a4900..3e894b43d 100644 --- a/packages/core/src/blitzkit/api/server/1_tankDefinitions.ts +++ b/packages/core/src/blitzkit/api/server/1_tankDefinitions.ts @@ -339,6 +339,17 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 { equalizer = { health, penetration, module_health, damage, armor }; } + const blitzTankClass = tankTags.find( + (tag) => tag in this.blitzTankClassToBlitzkit, + ); + + if (blitzTankClass === undefined) { + throw new Error(`Unknown tank class for ${nation}:${tankKey}`); + } + + const tankClass = + this.blitzTankClassToBlitzkit[blitzTankClass as BlitzTankClass]; + tankDefinitions.tanks[tankId] = { ancestors: [], successors: [], @@ -368,7 +379,7 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 { ? TankType.TANK_TYPE_PREMIUM : TankType.TANK_TYPE_RESEARCHABLE, tier: tank.level, - class: this.blitzTankClassToBlitzkit[tankTags[0] as BlitzTankClass], + class: tankClass, testing: tankTags.includes("testTank"), deprecated: tankTags.includes("deprecated"), price: tankPrice,