From d51730f69fff0ebdf58b78912c18c31efe133ae8 Mon Sep 17 00:00:00 2001 From: LixeiroCharmoso Date: Thu, 17 Oct 2024 22:37:32 +0100 Subject: [PATCH] Fix issue when vehicle health returns NaN --- client.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client.lua b/client.lua index 230d4f9..f2e8daa 100644 --- a/client.lua +++ b/client.lua @@ -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, @@ -793,7 +797,7 @@ CreateThread(function() harness, hp, math.ceil(GetEntitySpeed(vehicle) * speedMultiplier), - (GetVehicleEngineHealth(vehicle) / 10), + (engineHealth / 10), Menu.isCinematicModeChecked, dev, radioActive,