This commit is contained in:
@@ -7,13 +7,12 @@ export function gameTitle(game: string | null | undefined, compact = false): str
|
||||
}
|
||||
|
||||
export function mapTitle(map: string | null | undefined): string {
|
||||
return (
|
||||
[...T5_ZOMBIE_MAPS, ...T6_ZOMBIE_MAPS].find(
|
||||
(entry) => entry.canonical === map?.toLowerCase()
|
||||
)?.friendly ??
|
||||
map ??
|
||||
'—'
|
||||
const matches = [...T5_ZOMBIE_MAPS, ...T6_ZOMBIE_MAPS].filter(
|
||||
(entry) => entry.canonical === map?.toLowerCase()
|
||||
);
|
||||
// Engine identifiers alone cannot distinguish selections such as Town and TranZit.
|
||||
if (matches.length > 1) return `${map} (variant unknown)`;
|
||||
return matches[0]?.friendly ?? map ?? '—';
|
||||
}
|
||||
|
||||
export function serverTitle(name: string): string {
|
||||
|
||||
Reference in New Issue
Block a user