Fix param 4 and 5 for GET_NTH_CLOSEST_VEHICLE_NODE_ID_WITH_HEADING#255
Merged
Conversation
Owner
|
Looks like someone fixed this for rdr3-nativedb-data already: https://alloc8or.re/rdr3/nativedb/?n=0x4114EAA8A7F7766D |
… a Vector3*, but a float x,y,z coordinate
… a Vector3*, but a float x,y,z coordinate
…E_ID_WITH_HEADING
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.
See Freemode where the 5th argument being used, var4, couldn't be a Vector3, but must be float, and Var5 declared directly below it is being used as an int. These variables shouldn't overlap. Freemode @v3788:
If you reverse the native, it is clear that this parameter is filled with the heading in 0.0 to 360.0 degrees as a float pointer, not as a Vector3 pointer. (If it were, a wrapper would also be present to convert from 3 consecutive floats to 3 script floats with 8-byte alignment and there is none.) Furthermore the 6th argument is used internally as an int pointer, for numLanes. It seems the only difference between this function and
GET_NTH_CLOSEST_VEHICLE_NODE_WITH_HEADINGis that theVector3* outHeadingis omitted, instead of the numLanes parameter.This also explains why in Freemode func_1119 v3788
PATHFIND::GET_VEHICLE_NODE_POSITIONis called immediately after callingPATHFIND::GET_NTH_CLOSEST_VEHICLE_NODE_ID_WITH_HEADING, this wouldn't make sense otherwise.