@@ -34,13 +34,17 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
3434 var ID = o . TryGetValue ( "ID" , StringComparison . OrdinalIgnoreCase , out x ) ? ( string ) x : string . Empty ;
3535 var Count = o . TryGetValue ( "Count" , StringComparison . OrdinalIgnoreCase , out x ) ? ( int ) x : 0 ;
3636 var Experience = o . TryGetValue ( "Experience" , StringComparison . OrdinalIgnoreCase , out x ) ? ( int ) x : 0 ;
37- var tier = o . TryGetValue ( "UnlockTier" , StringComparison . OrdinalIgnoreCase , out x ) ? ( int ) x : 0 ;
38- var UnlockTier = ( UnlockTier ) tier ;
37+ var tier = o . TryGetValue ( "Rarity" , StringComparison . OrdinalIgnoreCase , out x )
38+ ? ( int ) x
39+ : o . TryGetValue ( "UnlockTier" , StringComparison . OrdinalIgnoreCase , out x )
40+ ? ( int ) x
41+ : 0 ;
42+ var Rarity = ( ItemRarity ) tier ;
3943 if ( o . Count > 4 )
4044 {
4145 if ( String . Equals ( ID , "sword_assassins" , StringComparison . OrdinalIgnoreCase ) )
4246 {
43- var aItem = new AssassinsSword ( ) { ID = ID , Count = Count , Experience = Experience , UnlockTier = UnlockTier } ;
47+ var aItem = new AssassinsSword ( ) { ID = ID , Count = Count , Experience = Experience , Rarity = Rarity } ;
4448 JToken a ;
4549 var CurrentKills = o . TryGetValue ( "CurrentKills" , StringComparison . OrdinalIgnoreCase , out a ) ? ( int ) x : 0 ;
4650 var Level = o . TryGetValue ( "Level" , StringComparison . OrdinalIgnoreCase , out a ) ? ( int ) x : 0 ;
@@ -50,7 +54,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
5054 }
5155 else if ( familiars . Contains ( ID , StringComparer . OrdinalIgnoreCase ) )
5256 {
53- var fItem = new FamiliarItem ( ) { ID = ID , Count = Count , Experience = Experience , UnlockTier = UnlockTier } ;
57+ var fItem = new FamiliarItem ( ) { ID = ID , Count = Count , Experience = Experience , Rarity = Rarity } ;
5458 JToken f ;
5559 var Position = o . TryGetValue ( "Position" , StringComparison . OrdinalIgnoreCase , out f ) ? JsonConvert . DeserializeObject < Vector2 > ( f . ToString ( ) , new XNAVector2Converter ( ) ) : default ( Vector2 ) ;
5660 var LVL = o . TryGetValue ( "LVL" , StringComparison . OrdinalIgnoreCase , out f ) ? ( int ) f : 0 ;
@@ -63,7 +67,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
6367 return fItem ;
6468 }
6569 }
66- return new Item ( ) { ID = ID , Count = Count , Experience = Experience , UnlockTier = UnlockTier } ;
70+ return new Item ( ) { ID = ID , Count = Count , Experience = Experience , Rarity = Rarity } ;
6771 }
6872 }
6973}
0 commit comments