fixes crash on production structure being destroyed; refund instead
This commit is contained in:
@@ -342,7 +342,7 @@ namespace OpenRa.Game
|
||||
&& producerTypes.Contains(a.unitInfo.Name) && a.Owner == player);
|
||||
|
||||
if (producer == null)
|
||||
throw new InvalidOperationException("BuildUnit without suitable production structure!");
|
||||
player.CancelProduction(Rules.UnitCategory[name]);
|
||||
|
||||
Actor unit;
|
||||
|
||||
@@ -375,7 +375,7 @@ namespace OpenRa.Game
|
||||
}
|
||||
|
||||
world.Add(unit);
|
||||
player.FinishProduction( Rules.UnitCategory[ unit.unitInfo.Name ] );
|
||||
player.FinishProduction(Rules.UnitCategory[name]);
|
||||
|
||||
if (producer.traits.Contains<RenderWarFactory>())
|
||||
producer.traits.Get<RenderWarFactory>().EjectUnit();
|
||||
|
||||
Reference in New Issue
Block a user