mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-12 22:58:01 +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>
|
||||
public static async Task<InventoryPurchaseResult?> StartPurchaseAsync( InventoryDef[] items )
|
||||
{
|
||||
var item_i = items.Select( x => x._id ).ToArray();
|
||||
var item_q = items.Select( x => (uint)1 ).ToArray();
|
||||
var d = items.GroupBy( x => x._id ).ToDictionary( x => x.Key, x => (uint) x.Count() );
|
||||
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 );
|
||||
if ( !r.HasValue ) return null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user