use Defines.k_SteamInventoryResultInvalid instead of default

This commit is contained in:
Garry Newman 2020-02-27 10:02:03 +00:00
parent 9db103cb2f
commit 631969360c
2 changed files with 12 additions and 12 deletions

View File

@ -177,7 +177,7 @@ namespace Steamworks
/// </summary>
public static bool GetAllItems()
{
var sresult = default( SteamInventoryResult_t );
var sresult = Defines.k_SteamInventoryResultInvalid;
return Internal.GetAllItems( ref sresult );
}
@ -186,7 +186,7 @@ namespace Steamworks
/// </summary>
public static async Task<InventoryResult?> GetAllItemsAsync()
{
var sresult = default( SteamInventoryResult_t );
var sresult = Defines.k_SteamInventoryResultInvalid;
if ( !Internal.GetAllItems( ref sresult ) )
return null;
@ -202,7 +202,7 @@ namespace Steamworks
/// </summary>
public static async Task<InventoryResult?> GenerateItemAsync( InventoryDef target, int amount )
{
var sresult = default( SteamInventoryResult_t );
var sresult = Defines.k_SteamInventoryResultInvalid;
var defs = new InventoryDefId[] { target.Id };
var cnts = new uint[] { (uint)amount };
@ -220,7 +220,7 @@ namespace Steamworks
/// </summary>
public static async Task<InventoryResult?> CraftItemAsync( InventoryItem[] list, InventoryDef target )
{
var sresult = default( SteamInventoryResult_t );
var sresult = Defines.k_SteamInventoryResultInvalid;
var give = new InventoryDefId[] { target.Id };
var givec = new uint[] { 1 };
@ -241,7 +241,7 @@ namespace Steamworks
/// </summary>
public static async Task<InventoryResult?> CraftItemAsync( InventoryItem.Amount[] list, InventoryDef target )
{
var sresult = default( SteamInventoryResult_t );
var sresult = Defines.k_SteamInventoryResultInvalid;
var give = new InventoryDefId[] { target.Id };
var givec = new uint[] { 1 };
@ -283,7 +283,7 @@ namespace Steamworks
{
Marshal.Copy( data, 0, ptr, dataLength );
var sresult = default( SteamInventoryResult_t );
var sresult = Defines.k_SteamInventoryResultInvalid;
if ( !Internal.DeserializeResult( ref sresult, (IntPtr)ptr, (uint)dataLength, false ) )
return null;
@ -304,7 +304,7 @@ namespace Steamworks
/// </summary>
public static async Task<InventoryResult?> GrantPromoItemsAsync()
{
var sresult = default( SteamInventoryResult_t );
var sresult = Defines.k_SteamInventoryResultInvalid;
if ( !Internal.GrantPromoItems( ref sresult ) )
return null;
@ -318,7 +318,7 @@ namespace Steamworks
/// </summary>
public static async Task<InventoryResult?> TriggerItemDropAsync( InventoryDefId id )
{
var sresult = default( SteamInventoryResult_t );
var sresult = Defines.k_SteamInventoryResultInvalid;
if ( !Internal.TriggerItemDrop( ref sresult, id ) )
return null;
@ -332,7 +332,7 @@ namespace Steamworks
/// </summary>
public static async Task<InventoryResult?> AddPromoItemAsync( InventoryDefId id )
{
var sresult = default( SteamInventoryResult_t );
var sresult = Defines.k_SteamInventoryResultInvalid;
if ( !Internal.AddPromoItem( ref sresult, id ) )
return null;

View File

@ -53,7 +53,7 @@ namespace Steamworks
/// </summary>
public async Task<InventoryResult?> ConsumeAsync( int amount = 1 )
{
var sresult = default( SteamInventoryResult_t );
var sresult = Defines.k_SteamInventoryResultInvalid;
if ( !SteamInventory.Internal.ConsumeItem( ref sresult, Id, (uint)amount ) )
return null;
@ -65,7 +65,7 @@ namespace Steamworks
/// </summary>
public async Task<InventoryResult?> SplitStackAsync( int quantity = 1 )
{
var sresult = default( SteamInventoryResult_t );
var sresult = Defines.k_SteamInventoryResultInvalid;
if ( !SteamInventory.Internal.TransferItemQuantity( ref sresult, Id, (uint)quantity, ulong.MaxValue ) )
return null;
@ -77,7 +77,7 @@ namespace Steamworks
/// </summary>
public async Task<InventoryResult?> AddAsync( InventoryItem add, int quantity = 1 )
{
var sresult = default( SteamInventoryResult_t );
var sresult = Defines.k_SteamInventoryResultInvalid;
if ( !SteamInventory.Internal.TransferItemQuantity( ref sresult, add.Id, (uint)quantity, Id ) )
return null;