diff --git a/ArchiSteamFarm/Steam/Data/Asset.cs b/ArchiSteamFarm/Steam/Data/Asset.cs index 5a3510de2..4b36d0e8e 100644 --- a/ArchiSteamFarm/Steam/Data/Asset.cs +++ b/ArchiSteamFarm/Steam/Data/Asset.cs @@ -37,7 +37,7 @@ public sealed class Asset { public const ulong SteamPointsShopInstanceID = 3865004543; [JsonIgnore] - public CEcon_Asset Body { get; } = new(); + public CEcon_Asset Body { get; } [JsonIgnore] public bool IsSteamPointsShopItem => !Tradable && (InstanceID == SteamPointsShopInstanceID); @@ -123,7 +123,7 @@ public sealed class Asset { Description = description; } - public Asset(uint appID, ulong contextID, ulong classID, uint amount, InventoryDescription? description = null, ulong assetID = 0, ulong instanceID = 0) { + public Asset(uint appID, ulong contextID, ulong classID, uint amount, InventoryDescription? description = null, ulong assetID = 0, ulong instanceID = 0) : this() { ArgumentOutOfRangeException.ThrowIfZero(appID); ArgumentOutOfRangeException.ThrowIfZero(contextID); ArgumentOutOfRangeException.ThrowIfZero(classID); @@ -140,7 +140,7 @@ public sealed class Asset { } [JsonConstructor] - private Asset() { } + private Asset() => Body = new CEcon_Asset(); public Asset DeepClone() => new(Serializer.DeepClone(Body), Description?.DeepClone()); } diff --git a/ArchiSteamFarm/Steam/Data/InventoryDescription.cs b/ArchiSteamFarm/Steam/Data/InventoryDescription.cs index 1d05a75f2..d7b6415f1 100644 --- a/ArchiSteamFarm/Steam/Data/InventoryDescription.cs +++ b/ArchiSteamFarm/Steam/Data/InventoryDescription.cs @@ -38,7 +38,7 @@ namespace ArchiSteamFarm.Steam.Data; [PublicAPI] public sealed class InventoryDescription { [JsonIgnore] - public CEconItem_Description Body { get; } = new(); + public CEconItem_Description Body { get; } [JsonInclude] [JsonPropertyName("appid")] @@ -531,7 +531,7 @@ public sealed class InventoryDescription { Body = description; } - public InventoryDescription(uint appID, ulong classID, ulong instanceID = 0, bool marketable = false, bool tradable = false, uint realAppID = 0, EAssetType type = EAssetType.Unknown, EAssetRarity rarity = EAssetRarity.Unknown) { + public InventoryDescription(uint appID, ulong classID, ulong instanceID = 0, bool marketable = false, bool tradable = false, uint realAppID = 0, EAssetType type = EAssetType.Unknown, EAssetRarity rarity = EAssetRarity.Unknown) : this() { ArgumentOutOfRangeException.ThrowIfZero(appID); ArgumentOutOfRangeException.ThrowIfZero(classID); @@ -555,7 +555,7 @@ public sealed class InventoryDescription { } [JsonConstructor] - private InventoryDescription() { } + private InventoryDescription() => Body = new CEconItem_Description(); public InventoryDescription DeepClone() => new(Serializer.DeepClone(Body)); }