Fix ProductionBar visually glitching for units without value
This commit is contained in:
@@ -77,7 +77,12 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var current = queue.AllQueued().Where(i => i.Started).MinByOrDefault(i => i.RemainingTime);
|
var current = queue.AllQueued().Where(i => i.Started).MinByOrDefault(i => i.RemainingTime);
|
||||||
value = current != null ? 1 - (float)current.RemainingCost / current.TotalCost : 0;
|
if (current == null)
|
||||||
|
value = 0;
|
||||||
|
else if (current.TotalCost <= 0)
|
||||||
|
value = 1;
|
||||||
|
else
|
||||||
|
value = 1 - (float)current.RemainingCost / current.TotalCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
float ISelectionBar.GetValue()
|
float ISelectionBar.GetValue()
|
||||||
|
|||||||
Reference in New Issue
Block a user