Added support for filtering exits by production type.

This commit is contained in:
GSonderling
2017-12-09 22:22:48 +00:00
committed by reaperrr
parent 1bf59e885d
commit 488cec64b8
16 changed files with 116 additions and 34 deletions

View File

@@ -10,7 +10,6 @@
#endregion
using System.Drawing;
using OpenRA;
using OpenRA.Primitives;
using OpenRA.Traits;
@@ -41,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits
rp = self.TraitOrDefault<RallyPoint>();
}
public override bool Produce(Actor self, ActorInfo producee, TypeDictionary inits)
public override bool Produce(Actor self, ActorInfo producee, string productionType, TypeDictionary inits)
{
var aircraftInfo = producee.TraitInfoOrDefault<AircraftInfo>();
var mobileInfo = producee.TraitInfoOrDefault<MobileInfo>();
@@ -96,7 +95,7 @@ namespace OpenRA.Mods.Common.Traits
var notifyOthers = self.World.ActorsWithTrait<INotifyOtherProduction>();
foreach (var notify in notifyOthers)
notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit);
notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit, productionType);
foreach (var t in newUnit.TraitsImplementing<INotifyBuildComplete>())
t.BuildingComplete(newUnit);