Fixes ReadOnlyNativePtrArray.IndexOf returning invalid index.
This commit is contained in:
parent
3a7edb2fc3
commit
ced4524737
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.
|
@ -62,10 +62,10 @@ namespace PkmnLibSharp.Utilities
|
|||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
var p = _ptr + (i * IntPtr.Size);
|
||||
if (item == null)
|
||||
var p = GetPtr(i);
|
||||
if (item == null && p == IntPtr.Zero)
|
||||
return i;
|
||||
if (p == item.Ptr)
|
||||
if (p == item?.Ptr)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue