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

View File

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