fivem
fivem copied to clipboard
GetPedCollectionLocalIndex Natives Returning Wrong Value
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