mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
fix tag0 assumption
This commit is contained in:
1 parent
a0111d8b69
commit
84f950ade4
3 files changed
+16
-2
No files matched your search
@@ -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.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "blitzkit",
|
||||
"version": "1.31.1",
|
||||
"version": "1.31.2",
|
||||
"license": "BlitzKit License",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user