From d9281d7a13013c6a434e5e308f52f53a9f1ab4d0 Mon Sep 17 00:00:00 2001 From: Bob Date: Mon, 25 Jan 2010 22:36:08 +1300 Subject: [PATCH] fixed potential div-by-zero for items that build quickly --- OpenRa.Game/ProductionItem.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenRa.Game/ProductionItem.cs b/OpenRa.Game/ProductionItem.cs index 91f399075c..4a580feacd 100644 --- a/OpenRa.Game/ProductionItem.cs +++ b/OpenRa.Game/ProductionItem.cs @@ -18,6 +18,8 @@ namespace OpenRa public ProductionItem(string item, int time, int cost, Action onComplete) { + if( time <= 0 ) + time = 1; Item = item; RemainingTime = TotalTime = time; RemainingCost = TotalCost = cost;