Skip to content

Commit

Permalink
Revert "fix: show ? in !np when slot is still inacurate"
Browse files Browse the repository at this point in the history
This reverts commit 24185ed.
  • Loading branch information
Geczy committed Aug 31, 2024
1 parent 24185ed commit 250c1fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/dota/src/dota/lib/heroes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ export const translatedColor = (color: string, lng: string) => {
}

export const heroColors = 'Blue,Teal,Purple,Yellow,Orange,Pink,Olive,Cyan,Green,Brown'.split(',')
export function getHeroNameOrColor(id?: number, index?: number) {
export function getHeroNameOrColor(id: number, index?: number) {
if (!id && typeof index === 'number') return heroColors[index]

const hero = getHeroById(id)
Expand Down
7 changes: 3 additions & 4 deletions packages/dota/src/steam/notableplayers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,13 @@ export async function notablePlayers({
})

const proPlayers: NotablePlayer[] = []
matchPlayers.forEach((player, i: number) => {
matchPlayers.forEach((player: Player, i: number) => {
const np = nps.find((np) => np.account_id === player.accountid)
const props = {
account_id: player.accountid,
heroId: player.heroid ?? 0,
heroId: player.heroid,
position: i,
heroName:
player.playerid >= 0 ? getHeroNameOrColor(player.heroid ?? 0, player.playerid) : '?',
heroName: getHeroNameOrColor(player.heroid, i),
name: np?.name ?? `Player ${i + 1}`,
country_code: np?.country_code ?? '',
isMe: steam32Id === player.accountid,
Expand Down

0 comments on commit 250c1fc

Please sign in to comment.