-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
tweak(extra-natives/five): sanitize mission train creation #2982
tweak(extra-natives/five): sanitize mission train creation #2982
Conversation
There was a bug that broke building the server project, but it has been fixed in master. Can you merge that fix into your branch? I will do a review once that's done. Thank you! |
6a690f8
to
8d91379
Compare
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing that jumps out at me is whether train.h
should be in extra-natives-five
, but I don't think that's a big enough reason to not approve this MR at this point. Looks good.
hey @Ehbw in case you did not notice yet but @prikolium-cfx merged some of your other commits recently :) |
Could you please rebase it from master? |
8d91379
to
26f999b
Compare
26f999b
to
4858e5b
Compare
Goal of this PR
Prevent client crashes when using the CREATE_MISSION_TRAIN native.
How is this PR achieving the goal
By adding checks that are missing with the original native implementation. Such as invalid train variations (that do not exist in trains.xml), required carriage models not being loaded, and checking to ensure that there is at least a single track enabled to create a train on (this wouldn't crash the client, but would rather return a native error in the console which could be confusing to users).
This PR also moves some Train structs from TrackNatives to a Train header file to reduce code duplication
This PR applies to the following area(s)
FiveM
Successfully tested on
Game builds: 1604, 2060, 2372, 2545, 2699, 2802, 3095, 3258, 3407
Platforms: Windows
I've created a repro resource to reproduce the crashes and their new behaviour with this PR.
train-crash-test.zip
Checklist
Fixes issues