Skip to content

Commit

Permalink
Merge pull request #196 from LeonardoSoares98/main
Browse files Browse the repository at this point in the history
Fix issue when vehicle health returns NaN
  • Loading branch information
GhzGarage authored Nov 13, 2024
2 parents 4ec5deb + d51730f commit 7c61265
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,10 @@ CreateThread(function()
DisplayRadar(true)
end
wasInVehicle = true
local engineHealth = GetVehicleEngineHealth(vehicle)
if engineHealth ~= engineHealth then -- This checks for NaN, as any NaN value is not equal to itself
engineHealth = 0
end
updatePlayerHud({
show,
Menu.isDynamicHealthChecked,
Expand Down Expand Up @@ -793,7 +797,7 @@ CreateThread(function()
harness,
hp,
math.ceil(GetEntitySpeed(vehicle) * speedMultiplier),
(GetVehicleEngineHealth(vehicle) / 10),
(engineHealth / 10),
Menu.isCinematicModeChecked,
dev,
radioActive,
Expand Down

0 comments on commit 7c61265

Please sign in to comment.