@@ -395,6 +395,7 @@ export interface ApiChampionPositionStat {
395395
396396export interface ApiChampionPositionStatsResponse {
397397 data ?: ApiChampionPositionStat [ ]
398+ heroes ?: ApiHero [ ]
398399 source ?: string
399400 region ?: string
400401 tier ?: string
@@ -726,6 +727,7 @@ export function normalizeChampions(
726727 const statKey = String ( stat . key || stat . name || sortIndex )
727728 const officialHero = heroId ? heroById . get ( heroId ) : undefined
728729 const alias = officialHero ?. alias || stat . key || String ( heroId )
730+ const fallbackImageUrl = heroId ? `/lol_champion_icon/${ heroId } .png` : undefined
729731 const lane = roleToLane [ role ]
730732 const fallbackWinRate = heroId ? ( laneStats [ String ( heroId ) ] ?. [ lane ] ?? 0.5 ) : 0.5
731733 const winRate = Number . isFinite ( stat . positionWinRate )
@@ -775,7 +777,7 @@ export function normalizeChampions(
775777 heroId : Number . isFinite ( counterHeroId ) ? counterHeroId : undefined ,
776778 name : officialCounter ?. name || counter . name || counter . key || '' ,
777779 en : officialCounter ?. alias || counter . key || String ( counterHeroId || '' ) ,
778- imageUrl : officialCounter ?. heroLogo || counter . img_url ,
780+ imageUrl : officialCounter ?. heroLogo || counter . img_url || ( Number . isFinite ( counterHeroId ) ? `/lol_champion_icon/ ${ counterHeroId } .png` : undefined ) ,
779781 winRate : counterWinRate ,
780782 games : Number . isFinite ( counterGames ) ? counterGames : undefined ,
781783 wins : Number . isFinite ( counterWins ) ? counterWins : undefined ,
@@ -792,7 +794,7 @@ export function normalizeChampions(
792794 dataSource : source ,
793795 sourceLabel : source === 'cn' ? '中国区 · 101' : '全球 · OP.GG' ,
794796 role,
795- imageUrl : officialHero ?. heroLogo || stat . image_url ,
797+ imageUrl : officialHero ?. heroLogo || stat . image_url || fallbackImageUrl ,
796798 banRate,
797799 pickRate,
798800 presenceRate,
0 commit comments