Bugfix: "Unit production requires a right-click before another unit can be produced."

This commit is contained in:
Bob
2009-10-30 09:35:18 +13:00
parent 4232974f3a
commit 816c927aa5
2 changed files with 7 additions and 1 deletions

View File

@@ -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<RenderWarFactory>())
producer.traits.Get<RenderWarFactory>().EjectUnit();

View File

@@ -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;
}