diff --git a/src/api/helpers/agent.ts b/src/api/helpers/agent.ts index 9327675..5a3475c 100644 --- a/src/api/helpers/agent.ts +++ b/src/api/helpers/agent.ts @@ -5,7 +5,9 @@ import type { Agent } from "../types"; * @throws Error if agent not found */ export function getAgent(this: ValorantApi, agentUUID: string): Agent { - const agent = this.content.agents.find(a => a.uuid === agentUUID); + const agent = this.content.agents.find( + a => a.uuid === agentUUID.toLowerCase(), + ); if (!agent) { throw Error(`Agent ${agentUUID} not found`); diff --git a/src/table/plugins/player-agent.plugin.ts b/src/table/plugins/player-agent.plugin.ts index 337be88..335e8cc 100644 --- a/src/table/plugins/player-agent.plugin.ts +++ b/src/table/plugins/player-agent.plugin.ts @@ -4,6 +4,7 @@ import { match } from "ts-pattern"; import { ValorantApi } from "~/api"; import { GAMESTATES, KnownGameStates } from "~/api/types"; import { AgentEntity } from "~/entities/definitions/agent.entity"; +import { LOGGER } from "~/logger"; import { inject } from "~/shared/dependencies"; import { RGBTuple } from "~/utils/colors"; import { tryCatch } from "~/utils/promise"; @@ -38,7 +39,12 @@ export const PlayerAgentPlugin = definePlugin({ value: formatAgent({ agent: tryCatch( () => api.helpers.getAgent(agent!.id).displayName, - () => UNKNOWN_AGENT, + () => { + LOGGER.forModule("Agent-Plugin").error( + `Agent not found, aid ${agent!.id}, puuid ${puuid}`, + ); + return UNKNOWN_AGENT; + }, ), isLocked: agent!.state === "locked", state: data._state,