From 6587db5a9d1cd43879ada15d60a5cfa47bf82824 Mon Sep 17 00:00:00 2001 From: Kamil Szurant Date: Tue, 19 Nov 2019 20:50:41 +0100 Subject: [PATCH] Fix for InvetoryDef Properties Otherwise we get error in `_properties[name] = vl;` as name is null. GetProperty(null) is called to get list of keys as string. I guess separate method would be cleaner but I'm keeping this example to minimum (or im too lazy). --- Facepunch.Steamworks/Structs/InventoryDef.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Facepunch.Steamworks/Structs/InventoryDef.cs b/Facepunch.Steamworks/Structs/InventoryDef.cs index 4475986..0f689aa 100644 --- a/Facepunch.Steamworks/Structs/InventoryDef.cs +++ b/Facepunch.Steamworks/Structs/InventoryDef.cs @@ -102,7 +102,10 @@ namespace Steamworks if ( !SteamInventory.Internal.GetItemDefinitionProperty( Id, name, out var vl, ref _ ) ) return null; - + + if (name == null) //return keys string + return vl; + if ( _properties == null ) _properties = new Dictionary(); @@ -235,4 +238,4 @@ namespace Steamworks } } -} \ No newline at end of file +}