fix: improve SCUM map playback filters
This commit is contained in:
@@ -5155,8 +5155,10 @@ export function vehicleAliasKeys(code: string): string[] {
|
||||
}
|
||||
|
||||
const vehicleIconAliases: Record<string, string> = {};
|
||||
const vehicleEntriesByIcon = new Map<string, ScumCatalogEntry>();
|
||||
for (const entry of scumCatalogEntries) {
|
||||
if (entry.kind !== "vehicle" || !entry.icon) continue;
|
||||
if (!vehicleEntriesByIcon.has(entry.icon)) vehicleEntriesByIcon.set(entry.icon, entry);
|
||||
for (const key of vehicleAliasKeys(entry.code)) vehicleIconAliases[key] = entry.icon;
|
||||
}
|
||||
|
||||
@@ -5239,7 +5241,7 @@ export function scumVehicleEntry(vehicleCode: string): ScumCatalogEntry | undefi
|
||||
for (const key of vehicleAliasKeys(vehicleCode)) {
|
||||
const icon = vehicleIconAliases[key];
|
||||
if (!icon) continue;
|
||||
const entry = scumCatalogEntries.find((value) => value.kind === "vehicle" && value.icon === icon);
|
||||
const entry = vehicleEntriesByIcon.get(icon);
|
||||
if (entry) return entry;
|
||||
}
|
||||
return scumCatalogEntryFor(vehicleCode);
|
||||
|
||||
Reference in New Issue
Block a user