
; Show building health bar


	_building = _this
	? SELECTED == _building : exit
	SELECTED = _building
	

	
	#Loop
	? format["%1",SELECTED] != format["%1",_building]  ||  getDammage _building >= 1 : exit
	
		_health = (1 - getDammage _building) * 100
		_health = _health - (_health mod 1)
		if  (_health mod 10 >= 5) then {_health=_health - (_health mod 10) + 10} else {_health=_health - (_health mod 10)}
		_health = _health / 10
		? _health == 0 : _health=1
		_model = format ["\Dune\health\%1",_health]
		
_AnimationName = ""
_Type = "Billboard"
_TimerPeriod = 120
_LifeTime = 0.04
_Position = [0,0,5]
_MoveVelocity = [0,0,0]
_RotationVelocity = 0
_Weight = 80
_Volume = 0
_Rubbing = 0

_Size = [3.5]
_Color = [[0.5,0.5,0, 1]]
_AnimationPhase = [0]

_RandomDirectionPeriod = 0
_RandomDirectionIntensity = 0
_OnTimer = ""
_BeforeDestroy = ""
_Object = _building


drop [_model, _AnimationName, _Type, _TimerPeriod, _LifeTime, _Position, _MoveVelocity, _RotationVelocity, _Weight, _Volume, _Rubbing, _Size, _Color, _AnimationPhase, _RandomDirectionPeriod, _RandomDirectionIntensity, _OnTimer, _BeforeDestroy, _Object]
	
	
	
	~0.01
	goto "Loop"