File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,9 +32,59 @@ public async Task<IReadOnlyCollection<GameItem>> GetGameItemsAsync(string langua
3232 AddToParametersIfHasValue ( language , "language" , parameters ) ;
3333
3434 var gameItems = await CallMethodAsync < GameItemResultContainer > ( "GetGameItems" , 1 , parameters ) ;
35+
36+ // work around the stupid bug that Valve introduced with patch 6.86 which returns the wrong IDs
37+ foreach ( var gameItem in gameItems . Result . Items )
38+ {
39+ gameItem . Id = GetCorrectedId ( gameItem . Id , gameItem . Name ) ;
40+ }
41+
3542 return new ReadOnlyCollection < GameItem > ( gameItems . Result . Items ) ;
3643 }
3744
45+ private static int GetCorrectedId ( int id , string name )
46+ {
47+ // iron talon
48+ if ( id == 239 && name == "item_iron_talon" )
49+ {
50+ return 273 ;
51+ }
52+ // aether lens
53+ else if ( id == 232 && name == "item_aether_lens" )
54+ {
55+ return 1028 ;
56+ }
57+ // faerie fire
58+ else if ( id == 237 && name == "item_faerie_fire" )
59+ {
60+ return 1023 ;
61+ }
62+ // dragon lance
63+ else if ( id == 236 && name == "item_dragon_lance" )
64+ {
65+ return 1025 ;
66+ }
67+ // recipe: iron talon
68+ else if ( id == 238 && name == "item_recipe_iron_talon" )
69+ {
70+ return 272 ;
71+ }
72+ // recipe: aether lens
73+ else if ( id == 233 && name == "item_recipe_aether_lens" )
74+ {
75+ return 1027 ;
76+ }
77+ // recipe: dragon lance
78+ else if ( id == 234 && name == "item_dragon_lance" )
79+ {
80+ return 1024 ;
81+ }
82+ else
83+ {
84+ return id ;
85+ }
86+ }
87+
3888 public async Task < IReadOnlyCollection < Hero > > GetHeroesAsync ( string language = "" , bool itemizedOnly = false )
3989 {
4090 List < SteamWebRequestParameter > parameters = new List < SteamWebRequestParameter > ( ) ;
You can’t perform that action at this time.
0 commit comments