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

Train carriage bug/crash #894

Open
dimmyi opened this issue Mar 14, 2024 · 0 comments
Open

Train carriage bug/crash #894

dimmyi opened this issue Mar 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dimmyi
Copy link
Contributor

dimmyi commented Mar 14, 2024

It appears that the client automatically adds carriages with IDs in exact sequence, for example, if the main train is ID 365, the client (internally) will create carriages with IDs 366,367 and 368.

In openMP, carriages are only stored in available slots, and not necessarily in sequence, for example:

Slots:
365 - Ocuppied
366 -
367 -
368 - Ocuppied
369 -
370 -

openMP will create the main train in slot 366, and the carriages in slots 367, 369 and 370, that is, it is not in sequence and the ID that will be created for the client will be occupied by another vehicle or a non-existent one.

In SA-MP I noticed that when you create a train, it will look for 4 available slots in sequence, so in the example above, sa-mp will create the main train in slot: 369 and the carriages in slots 370, 371 and 372

How to reproduce the bug:
https://www.youtube.com/watch?v=RADMmGx1LyQ

In the video you can see that the client internally removed a vehicle that was already created (NRG-500) and caused a warning.

How to fix?
Apparently, just do the same as SA-MP and only create the train if you find 4 available slots in sequence.

@dimmyi dimmyi added the bug Something isn't working label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant