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

Force tankHealth & oilLevel to be float values to fix leaking issue #1149

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

jrgrimshaw
Copy link
Contributor

@jrgrimshaw jrgrimshaw commented Nov 24, 2024

Description

We are getting a lot of reports of issues with fuel leaking especially; this seems to be due to SetVehicleProperties not forcing these values to be a float. Some scripts may write to the vehicle props JSON directly and set the float fuelTankHealth to an integer value of 1000, and people are incorrectly blaming QBCore for this.

These changes will safeguard players from this potential issue.

You can replicate this easily yourself by running the following - your car will instantly start leaking fuel. This doesn't happen when running the same code with the value 1000.0 instead of 1000.

local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
SetVehiclePetrolTankHealth(vehicle, 1000)

Checklist

  • I have personally loaded this code into an updated qbcore project and checked all of its functionality.
  • My code fits the style guidelines.
  • My PR fits the contribution guidelines.

@GhzGarage GhzGarage merged commit 12eefc3 into qbcore-framework:main Nov 26, 2024
2 checks passed
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.

3 participants