fivem icon indicating copy to clipboard operation
fivem copied to clipboard

GetPedCollectionLocalIndex Natives Returning Wrong Value

Open 1A3Dev opened this issue 1 year ago • 0 comments

What happened?

When using GetPedCollectionLocalIndexFromDrawable or GetPedCollectionLocalIndexFromProp which were added in https://github.com/citizenfx/fivem/commit/7dad6da713fc5c522f4c77d83803be6744f4b14f it returns 0 when the componentId/anchorPoint isn't valid and also if the global index is out of bounds.

Expected result

According to the native docs it should return -1 not 0 in the situations mentioned above

Reproduction steps

print(GetPedCollectionLocalIndexFromDrawable(PlayerPedId(), 0, -1))
print(GetPedCollectionLocalIndexFromDrawable(PlayerPedId(), 100, 9999))
print(GetPedCollectionLocalIndexFromProp(PlayerPedId(), 0, -1))
print(GetPedCollectionLocalIndexFromProp(PlayerPedId(), 100, 9999))

Importancy

Slight inconvenience

Area(s)

FiveM, Natives

Specific version(s)

10072/canary

Additional information

No response

1A3Dev avatar Oct 02 '24 13:10 1A3Dev