Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(five/streaming): expand train track array #3196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ehbw
Copy link
Contributor

@Ehbw Ehbw commented Feb 25, 2025

Goal of this PR

Expands the hardcoded track limit of 27 tracks to 127 (though can be easily expanded in the future by modifying kMaxTracks in extra-natives-five/TrackNatives.cpp and gta-streaming-five/PatchTrackLimits.cpp.

With the introduction of track switching with #3044 There is a bigger need for having more available tracks (Base GTA takes up 12, Leaving 15 for custom tracks that may be taken up by different map resources and track switching)

How is this PR achieving the goal

By replacing all instances of the original array holding track data and replacing it with a larger allocated array. All checks for trackIndex being less then 27 have also been replaced with kMaxTracks or kMaxTracks - 1.

This new PR also corrects a crash that occurred on canary with the previous PR.

This PR applies to the following area(s)

FiveM

Successfully tested on

For test and resource used for testing see #3191

All game builds tested were tested on debug, release. With default tracks, custom tracks and custom tracks exceeding the original 27 track limit.

Game builds: 2189, 2372, 2545, 2699, 2802, 2944, 3095, 3258, 3407

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Requires changes before it's considered valid and can be (re)triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant