From 9339477c89383de6e39c52ef51b76eccb876eb08 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 8 May 2019 14:52:47 +0100 Subject: [PATCH] SteamInventory.AddPromoItemAsync --- Facepunch.Steamworks/SteamInventory.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Facepunch.Steamworks/SteamInventory.cs b/Facepunch.Steamworks/SteamInventory.cs index 1f6925e..e6a1a6b 100644 --- a/Facepunch.Steamworks/SteamInventory.cs +++ b/Facepunch.Steamworks/SteamInventory.cs @@ -330,5 +330,20 @@ namespace Steamworks return await InventoryResult.GetAsync( sresult ); } + + /// + /// Trigger a promo item drop. You can call this at startup, it won't + /// give users multiple promo drops. + /// + public static async Task AddPromoItemAsync( InventoryDefId id ) + { + var sresult = default( SteamInventoryResult_t ); + + if ( !Internal.AddPromoItem( ref sresult, id ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + } } \ No newline at end of file