mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
only supply full name if it's different
This commit is contained in:
1 parent
6153beced6
commit
f3a8f2faab
2 files changed
+21
-11
No files matched your search
@@ -350,6 +350,15 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 {
|
||||
const tankClass =
|
||||
this.blitzTankClassToBlitzkit[blitzTankClass as BlitzTankClass];
|
||||
|
||||
const canonicalFullName = this.getString(tank.userString);
|
||||
const name =
|
||||
(tank.shortUserString
|
||||
? this.getString(tank.shortUserString)
|
||||
: undefined) ?? canonicalFullName;
|
||||
// only supply full name if it's different from the displayed short name to save some bytes
|
||||
const name_full =
|
||||
name === canonicalFullName ? undefined : canonicalFullName;
|
||||
|
||||
tankDefinitions.tanks[tankId] = {
|
||||
ancestors: [],
|
||||
successors: [],
|
||||
@@ -367,13 +376,8 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 {
|
||||
typeof equipment === "string" ? equipment : equipment.at(-1)!,
|
||||
max_consumables: tankDefinition.root.consumableSlots,
|
||||
max_provisions: tankDefinition.root.provisionSlots,
|
||||
name:
|
||||
(tank.shortUserString
|
||||
? this.getString(tank.shortUserString)
|
||||
: undefined) ?? this.getString(tank.userString),
|
||||
name_full: tank.shortUserString
|
||||
? this.getString(tank.userString)
|
||||
: undefined,
|
||||
name,
|
||||
name_full,
|
||||
slug,
|
||||
nation,
|
||||
type: tankTags.includes("collectible")
|
||||
|
||||
Reference in new issue
Block a user