diff --git a/src/client/graphics/layers/PlayerPanel.ts b/src/client/graphics/layers/PlayerPanel.ts index 6a60675d20..f869c72e1d 100644 --- a/src/client/graphics/layers/PlayerPanel.ts +++ b/src/client/graphics/layers/PlayerPanel.ts @@ -491,12 +491,17 @@ export class PlayerPanel extends LitElement implements Layer { `; } - private renderIdentityRow(other: PlayerView, my: PlayerView) { - const flagCode = other.cosmetics.flag; - const country = - typeof flagCode === "string" - ? Countries.find((c) => c.code === flagCode) - : undefined; + private renderIdentityRow( + other: PlayerView, + my: PlayerView, + ) { + const activeFlagPath = other.cosmetics.flag + const flagCode = activeFlagPath?.match(/\/([^.]+)\./)?.[1]; + + // Find the country based on that code + const country = flagCode + ? Countries.find((c) => c.code === flagCode.split("/")[1]) + : flagCode; const chip = other.type() === PlayerType.Human @@ -505,10 +510,11 @@ export class PlayerPanel extends LitElement implements Layer { return html`