Skip to content

Commit f5f9655

Browse files
committed
if true set true; else, set false
1 parent 6c4abe6 commit f5f9655

1 file changed

Lines changed: 3 additions & 15 deletions

File tree

LuaUI/Widgets/unit_smart_nanos.lua

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)