Skip to content

Commit

Permalink
Closes #3289
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Sep 13, 2024
1 parent 73d756f commit 061e61b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ArchiSteamFarm/Steam/Data/InventoryDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,10 @@ public EAssetRarity Rarity {
}
case "RARITY":
string[] internalNameArgs = tag.internal_name.Split('_', 2, StringSplitOptions.RemoveEmptyEntries);
string rarityText = internalNameArgs.Length > 1 ? internalNameArgs[1] : internalNameArgs[0];

if ((internalNameArgs.Length >= 2) && Enum.TryParse(internalNameArgs[1], true, out EAssetRarity assetRarity) && Enum.IsDefined(assetRarity)) {
CachedRarity = assetRarity;
if (Enum.TryParse(rarityText, true, out EAssetRarity rarity) && Enum.IsDefined(rarity)) {
CachedRarity = rarity;
} else {
ASF.ArchiLogger.LogGenericError(Strings.FormatWarningUnknownValuePleaseReport(nameof(tag.internal_name), tag.internal_name));

Expand Down

0 comments on commit 061e61b

Please sign in to comment.