mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-13 07:08:05 +03:00
StartPurchaseAsync: Should now be able to pass in multiple of the same item to purchase multiples
This commit is contained in:
parent
ae70292e7b
commit
9fecd91bed
@ -347,8 +347,9 @@ namespace Steamworks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static async Task<InventoryPurchaseResult?> StartPurchaseAsync( InventoryDef[] items )
|
public static async Task<InventoryPurchaseResult?> StartPurchaseAsync( InventoryDef[] items )
|
||||||
{
|
{
|
||||||
var item_i = items.Select( x => x._id ).ToArray();
|
var d = items.GroupBy( x => x._id ).ToDictionary( x => x.Key, x => (uint) x.Count() );
|
||||||
var item_q = items.Select( x => (uint)1 ).ToArray();
|
var item_i = d.Keys.ToArray();
|
||||||
|
var item_q = d.Values.ToArray();
|
||||||
|
|
||||||
var r = await Internal.StartPurchase( item_i, item_q, (uint)item_i.Length );
|
var r = await Internal.StartPurchase( item_i, item_q, (uint)item_i.Length );
|
||||||
if ( !r.HasValue ) return null;
|
if ( !r.HasValue ) return null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user