diff --git a/OpenRA.Mods.Common/Traits/Render/ProductionBar.cs b/OpenRA.Mods.Common/Traits/Render/ProductionBar.cs index c22c1454aa..9b5165ec43 100644 --- a/OpenRA.Mods.Common/Traits/Render/ProductionBar.cs +++ b/OpenRA.Mods.Common/Traits/Render/ProductionBar.cs @@ -77,7 +77,12 @@ namespace OpenRA.Mods.Common.Traits.Render return; 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()