diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index 1d6a0f8cbb..7e9919d5ad 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -252,7 +252,8 @@ namespace OpenRa.Game mobile.QueueActivity(new Mobile.MoveTo(unit.Location + new int2(0, 3))); } - world.Add(unit); + world.Add( unit ); + player.FinishProduction( Rules.UnitCategory[ unit.unitInfo.Name ] ); if (producer.traits.Contains()) producer.traits.Get().EjectUnit(); diff --git a/OpenRa.Game/Player.cs b/OpenRa.Game/Player.cs index 4bc1cac5b0..3545bd1221 100644 --- a/OpenRa.Game/Player.cs +++ b/OpenRa.Game/Player.cs @@ -61,6 +61,11 @@ namespace OpenRa.Game var item = production[ category ]; if( item == null ) return; GiveCash( item.TotalCost - item.RemainingCost ); // refund what's been paid so far. + FinishProduction( category ); + } + + public void FinishProduction( string category ) + { production[ category ] = null; }