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

refactor: vehicle props as statebag #412

Merged
merged 5 commits into from
Mar 13, 2024
Merged

refactor: vehicle props as statebag #412

merged 5 commits into from
Mar 13, 2024

Conversation

solareon
Copy link
Member

@solareon solareon commented Mar 12, 2024

Description

Vehicle props are sadly a client side thing. This change moves the logic from a callback to a statebag which runs a loop on any client within scope to set the props on a vehicle. Extensive testing has shown this is the best method of ensuring that if you ask for a blue car with a wing that you get a blue car with a wing no matter who is zipping by at 400mph or if your client/server is a potato.

Fixes #316

Credit @FjamZoo for the ox_core version of this

Checklist

  • I have personally loaded this code into an updated Qbox project and checked all of its functionality.
  • My pull request fits the contribution guidelines & code conventions.

@solareon solareon changed the title Vehprops statebag refactor: vehicle props as statebag Mar 12, 2024
client/events.lua Show resolved Hide resolved
@jnccloud
Copy link
Contributor

jnccloud commented Mar 13, 2024

Does this still require modification of ox_lib (uncommenting a few lines as mentioned in #316)?

@solareon
Copy link
Member Author

Does this still require modification of ox_lib (uncommenting a few lines as mentioned in #316)?

@jnccloud No this moves the modification into the core while still using the ox_lib functionally to do the actual prop settings

modules/lib.lua Outdated Show resolved Hide resolved
client/events.lua Outdated Show resolved Hide resolved
modules/lib.lua Outdated Show resolved Hide resolved
Co-authored-by: Zoo <34508112+FjamZoo@users.noreply.github.com>
@FjamZoo FjamZoo merged commit 4f09676 into main Mar 13, 2024
4 checks passed
@solareon solareon deleted the vehprops-statebag branch March 13, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vehicle spawning irregularities
4 participants