Rework misclibrary gettime to not segfault
This commit is contained in:
@@ -11,22 +11,16 @@ namespace PkmnLibSharp.Battling
|
||||
{
|
||||
public class MiscLibrary : PointerWrapper
|
||||
{
|
||||
private delegate TimeOfDay GetTimeDelegate();
|
||||
public delegate TimeOfDay GetTimeDelegate();
|
||||
|
||||
internal MiscLibrary(IntPtr ptr) : base(ptr)
|
||||
{
|
||||
}
|
||||
public MiscLibrary()
|
||||
public MiscLibrary(GetTimeDelegate @delegate)
|
||||
{
|
||||
GetTimeDelegate getTime = GetTime;
|
||||
Initialize(Pkmnlib.Generated.MiscLibrary.Construct(Marshal.GetFunctionPointerForDelegate(getTime)));
|
||||
Initialize(Pkmnlib.Generated.MiscLibrary.Construct(Marshal.GetFunctionPointerForDelegate(@delegate)));
|
||||
}
|
||||
|
||||
public virtual TimeOfDay GetTime()
|
||||
{
|
||||
return TimeOfDay.Morning;
|
||||
}
|
||||
|
||||
|
||||
public bool IsCritical(IntPtr move, Pokemon target, byte hitNumber)
|
||||
{
|
||||
byte b = 0;
|
||||
|
||||
BIN
PkmnLibSharp/Native/Linux/libArbutils.so
(Stored with Git LFS)
BIN
PkmnLibSharp/Native/Linux/libArbutils.so
(Stored with Git LFS)
Binary file not shown.
BIN
PkmnLibSharp/Native/Linux/libCreatureLib.so
(Stored with Git LFS)
BIN
PkmnLibSharp/Native/Linux/libCreatureLib.so
(Stored with Git LFS)
Binary file not shown.
BIN
PkmnLibSharp/Native/Linux/libpkmnLib.so
(Stored with Git LFS)
BIN
PkmnLibSharp/Native/Linux/libpkmnLib.so
(Stored with Git LFS)
Binary file not shown.
BIN
PkmnLibSharp/Native/Linux/libpkmnlib_ai.so
(Stored with Git LFS)
BIN
PkmnLibSharp/Native/Linux/libpkmnlib_ai.so
(Stored with Git LFS)
Binary file not shown.
Reference in New Issue
Block a user