@@ -252,11 +252,7 @@ function widget:Update(deltaTime)
252252 local curH , maxH = spGetUnitHealth (unitID )
253253 if curH and maxH then
254254 teamUnits [unitID ].rHealth = curH
255- if (curH < maxH ) then
256- teamUnits [unitID ].damaged = true
257- else
258- teamUnits [unitID ].damaged = false
259- end
255+ teamUnits [unitID ].damaged = curH < maxH
260256 else
261257 teamUnits [unitID ] = nil
262258 end
@@ -265,11 +261,7 @@ function widget:Update(deltaTime)
265261 local curH , maxH = spGetUnitHealth (unitID )
266262 if curH and maxH then
267263 allyUnits [unitID ].rHealth = curH
268- if (curH < maxH ) then
269- allyUnits [unitID ].damaged = true
270- else
271- allyUnits [unitID ].damaged = false
272- end
264+ allyUnits [unitID ].damaged = curH < maxH
273265 else
274266 allyUnits [unitID ] = nil
275267 end
@@ -282,11 +274,7 @@ function widget:Update(deltaTime)
282274 for unitID ,unitDefs in pairs (nanoTurrets ) do
283275 if (unitDefs .pointer == pointer ) then
284276 local curH , maxH = spGetUnitHealth (unitID )
285- if (curH < maxH ) then
286- nanoTurrets [unitID ].damaged = true
287- else
288- nanoTurrets [unitID ].damaged = false
289- end
277+ nanoTurrets [unitID ].damaged = curH < maxH
290278
291279 local prevCommand , _ , _ , prevUnit = spGetUnitCurrentCommand (unitID )
292280 local cQueueCount = spGetUnitCommandCount (unitID )
0 commit comments