Skip to content

Fix NPC native return values and GetPlayers/GetVehicles/GetActors count - #1303

Open
itsneufox wants to merge 2 commits into
openmultiplayer:masterfrom
itsneufox:npc-native-fixes
Open

itsneufox wants to merge 2 commits into
openmultiplayer:masterfrom
itsneufox:npc-native-fixes

Conversation

@itsneufox

Copy link
Copy Markdown
Contributor

NPC_IsEnteringVehicle checked the current seat, so it was false the whole time the NPC was walking to the door. Now true from NPC_EnterVehicle until seated.
NPC_IsMovingToPlayer ignored the playerid and was true when following anyone.
NPC_Create returned INVALID_PLAYER_ID (65535) on failure instead of INVALID_NPC_ID (-1).
GetPlayers, GetVehicles, GetActors and NPC_GetAll returned size + 1 when the array was too small, so looping up to the returned count went out of bounds. They now return how many they wrote.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant