Add NPC_GetVehiclePos and NPC_GetVehicleRot natives#1237
Open
Revelts wants to merge 1 commit into
Open
Conversation
Implements the INPC vehicle position/rotation getters added in SDK PR openmultiplayer/open.mp-sdk#71 and exposes them to PAWN as NPC_GetVehiclePos and NPC_GetVehicleRot, mirroring the existing NPC_SetVehiclePos / NPC_SetVehicleRot setters. Both getters return zero/identity when the NPC is not currently in a vehicle, matching the silent no-op semantics of the setters. Closes openmultiplayer#1197.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1197.
Summary
Adds the getter counterparts to
NPC_SetVehiclePos/NPC_SetVehicleRot, as requested in #1197.INPC::getVehiclePosition()andINPC::getVehicleRotation()— SDK side (see paired SDK PR add get vehicle position and rotation open.mp-sdk#71)NPC::getVehiclePosition()/NPC::getVehicleRotation()— implementations inServer/Components/NPCs/NPC/npc.cppNPC_GetVehiclePos(npcid, &Float:x, &Float:y, &Float:z)andNPC_GetVehicleRot(npcid, &Float:x, &Float:y, &Float:z)— PAWN natives inServer/Components/Pawn/Scripting/NPC/Natives.cppBoth getters return zero/identity when the NPC is not currently in a vehicle, matching the silent no-op semantics of the existing setters.
Depends on
324eb80); it will need to be re-pointed to the merged SHA once the SDK PR lands.A companion PR to openmultiplayer/omp-stdlib for the
.incdeclarations ofNPC_GetVehiclePos/NPC_GetVehicleRotis still to be opened.Test plan
NPC_GetVehiclePosandNPC_GetVehicleRotreturn values matching what was written via the corresponding settersVector3