fix nan hp

This commit is contained in:
Alexsandro Percy 2023-10-27 19:51:42 -03:00
parent 3a8475ea8c
commit a81abe7ae5

View file

@ -107,7 +107,7 @@ end
function airutils.setText(self, vehicle_name)
local properties = self.object:get_properties()
local formatted = ""
if type( self.hp_max ) != "number" then self.hp_max = 0.1 end --strange error when hpmax is NaN
if type(self.hp_max) ~= "number" then self.hp_max = 0.1 end --strange error when hpmax is NaN
if self.hp_max then
formatted = " Current hp: " .. string.format(
"%.2f", self.hp_max