diff --git a/lua/ui/game/unitview.lua b/lua/ui/game/unitview.lua index 2a9e0c3c36..70cb808f03 100644 --- a/lua/ui/game/unitview.lua +++ b/lua/ui/game/unitview.lua @@ -86,11 +86,11 @@ end local statFuncs = { function(info) - if info.massProduced > 0 or info.massConsumed > 0 then - local massUsed = info.massConsumed - if info.massRequested > 0 then - massUsed = info.massRequested - end + local massUsed = info.massConsumed + if info.massRequested > 0 then + massUsed = info.massRequested + end + if info.massProduced > 0 or massUsed > 0 then return string.format('%+d', math.ceil(info.massProduced - massUsed)), UIUtil.UIFile('/game/unit_view_icons/mass.dds'), '00000000' elseif info.armyIndex + 1 ~= GetFocusArmy() and info.kills == 0 and info.shieldRatio <= 0 then local armyData = GetArmiesTable().armiesTable[info.armyIndex+1] @@ -105,11 +105,11 @@ local statFuncs = { end end, function(info) - if info.energyProduced > 0 or info.energyConsumed > 0 then - local energyUsed = info.energyConsumed - if info.energyRequested > 0 then - energyUsed = info.energyRequested - end + local energyUsed = info.energyConsumed + if info.energyRequested > 0 then + energyUsed = info.energyRequested + end + if info.energyProduced > 0 or energyUsed > 0 then return string.format('%+d', math.ceil(info.energyProduced - energyUsed)) else return false