Update CreatureLib

This commit is contained in:
Deukhoofd 2020-08-22 15:45:50 +02:00
parent ba9333ebb7
commit 01fcbc1935
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 5 additions and 3 deletions

View File

@ -34,7 +34,8 @@ namespace PkmnLibSharp.Battling
public Pokemon SwapInto(ulong indexA, Pokemon pokemon)
{
var ptr = Creaturelib.Generated.CreatureParty.SwapInto(Ptr, indexA, pokemon.Ptr);
var ptr = IntPtr.Zero;
Creaturelib.Generated.CreatureParty.SwapInto(ref ptr, Ptr, indexA, pokemon.Ptr).Assert();
if (TryResolvePointer(ptr, out Pokemon? newPokemon))
return newPokemon!;
return new Pokemon(ptr);

View File

@ -41,12 +41,13 @@ namespace Creaturelib.Generated
[DllImport("CreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_CreatureParty_PackParty")]
internal static extern byte PackParty(IntPtr p);
/// <param name="out">Creature * &</param>
/// <param name="p">CreatureParty *</param>
/// <param name="index">long unsigned int</param>
/// <param name="creature">Creature *</param>
/// <returns>Creature *</returns>
/// <returns>unsigned char</returns>
[DllImport("CreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_CreatureParty_SwapInto")]
internal static extern IntPtr SwapInto(IntPtr p, ulong index, IntPtr creature);
internal static extern byte SwapInto(ref IntPtr @out, IntPtr p, ulong index, IntPtr creature);
/// <param name="p">const CreatureParty *</param>
/// <returns>bool</returns>