Skip to content

Commit

Permalink
Fix ISteamInventory_GetItemDefinitionIDs not passing in the size of t…
Browse files Browse the repository at this point in the history
…he array by ref
  • Loading branch information
rlabrecque committed Sep 8, 2019
1 parent 7af385e commit a52bae4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Plugins/Steamworks.NET/autogen/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ internal static class NativeMethods {

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemDefinitionIDs", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool ISteamInventory_GetItemDefinitionIDs(IntPtr instancePtr, [In, Out] SteamItemDef_t[] pItemDefIDs, out uint punItemDefIDsArraySize);
public static extern bool ISteamInventory_GetItemDefinitionIDs(IntPtr instancePtr, [In, Out] SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemDefinitionProperty", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
Expand Down
4 changes: 2 additions & 2 deletions Plugins/Steamworks.NET/autogen/isteamgameserverinventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ public static bool LoadItemDefinitions() {
/// <para> contain the total size necessary for a subsequent call. Otherwise, the call will</para>
/// <para> return false if and only if there is not enough space in the output array.</para>
/// </summary>
public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, out uint punItemDefIDsArraySize) {
public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) {
InteropHelp.TestIfAvailableGameServer();
return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), pItemDefIDs, out punItemDefIDsArraySize);
return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), pItemDefIDs, ref punItemDefIDsArraySize);
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Plugins/Steamworks.NET/autogen/isteaminventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ public static bool LoadItemDefinitions() {
/// <para> contain the total size necessary for a subsequent call. Otherwise, the call will</para>
/// <para> return false if and only if there is not enough space in the output array.</para>
/// </summary>
public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, out uint punItemDefIDsArraySize) {
public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) {
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamAPIContext.GetSteamInventory(), pItemDefIDs, out punItemDefIDsArraySize);
return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamAPIContext.GetSteamInventory(), pItemDefIDs, ref punItemDefIDsArraySize);
}

/// <summary>
Expand Down

0 comments on commit a52bae4

Please sign in to comment.