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++)
|
for (var i = 0; i < Count; i++)
|
||||||
{
|
{
|
||||||
var p = _ptr + (i * IntPtr.Size);
|
var p = GetPtr(i);
|
||||||
if (item == null)
|
if (item == null && p == IntPtr.Zero)
|
||||||
return i;
|
return i;
|
||||||
if (p == item.Ptr)
|
if (p == item?.Ptr)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue