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);
|
&& producerTypes.Contains(a.unitInfo.Name) && a.Owner == player);
|
||||||
|
|
||||||
if (producer == null)
|
if (producer == null)
|
||||||
throw new InvalidOperationException("BuildUnit without suitable production structure!");
|
player.CancelProduction(Rules.UnitCategory[name]);
|
||||||
|
|
||||||
Actor unit;
|
Actor unit;
|
||||||
|
|
||||||
@@ -375,7 +375,7 @@ namespace OpenRa.Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
world.Add(unit);
|
world.Add(unit);
|
||||||
player.FinishProduction( Rules.UnitCategory[ unit.unitInfo.Name ] );
|
player.FinishProduction(Rules.UnitCategory[name]);
|
||||||
|
|
||||||
if (producer.traits.Contains<RenderWarFactory>())
|
if (producer.traits.Contains<RenderWarFactory>())
|
||||||
producer.traits.Get<RenderWarFactory>().EjectUnit();
|
producer.traits.Get<RenderWarFactory>().EjectUnit();
|
||||||
|
|||||||
Reference in New Issue
Block a user