mirror of
https://github.com/APercy/airutils.git
synced 2025-03-15 08:01:22 +00:00
fix nan hp
This commit is contained in:
parent
f997944e37
commit
3a8475ea8c
2 changed files with 1 additions and 1 deletions
1
init.lua
1
init.lua
|
@ -107,6 +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 self.hp_max then
|
||||
formatted = " Current hp: " .. string.format(
|
||||
"%.2f", self.hp_max
|
||||
|
|
|
@ -110,7 +110,6 @@ function airutils.on_step(self,dtime,colinfo)
|
|||
local vel = self.object:get_velocity()
|
||||
local pos = self.object:get_pos()
|
||||
local props = self.object:get_properties()
|
||||
if type( self.hp_max ) != "number" then self.hp_max = 0.1 end --strange error when hpmax is NaN
|
||||
|
||||
-- handle visibility on radar
|
||||
if (pos and pos.y < airutils.radarMinHeight and props.show_on_minimap) then
|
||||
|
|
Loading…
Add table
Reference in a new issue