fix: specialWeapon null (#27)

main
spacemeowx2 2022-11-25 21:29:11 +08:00
parent 84752ea427
commit c9bdf54110
2 changed files with 6 additions and 5 deletions

View File

@ -486,8 +486,9 @@ export class StatInkExporter implements GameExporter {
splashtag_title: player.byname,
uniform:
SPLATNET3_STATINK_MAP.COOP_UNIFORM_MAP[b64Number(player.uniform.id)],
special:
SPLATNET3_STATINK_MAP.COOP_SPECIAL_MAP[b64Number(specialWeapon.id)],
special: specialWeapon
? SPLATNET3_STATINK_MAP.COOP_SPECIAL_MAP[b64Number(specialWeapon.id)]
: undefined,
weapons: await Promise.all(weapons.map((w) => this.mapCoopWeapon(w))),
golden_eggs: goldenDeliverCount,
golden_assist: goldenAssistCount,
@ -495,7 +496,7 @@ export class StatInkExporter implements GameExporter {
rescue: rescueCount,
rescued: rescuedCount,
defeat_boss: defeatEnemyCount,
disconnected: "no",
disconnected: specialWeapon ? "no" : "yes",
};
}
mapKing(id?: string) {

View File

@ -210,7 +210,7 @@ export type CoopHistoryPlayerResult = {
isMyself: boolean;
};
weapons: { name: string }[];
specialWeapon: {
specialWeapon: null | {
name: string;
id: string;
};
@ -446,7 +446,7 @@ export type StatInkCoopPlayer = {
number: string;
splashtag_title: string | null;
uniform?: "orange" | "green" | "yellow" | "pink" | "blue" | "black" | "white";
special: string;
special?: string;
weapons: string[];
golden_eggs: number;
golden_assist: number;