Added support for filtering exits by production type.
This commit is contained in:
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||
}
|
||||
|
||||
public void UnitProducedByOther(Actor self, Actor producer, Actor produced)
|
||||
public void UnitProducedByOther(Actor self, Actor producer, Actor produced, string productionType)
|
||||
{
|
||||
// No recursive cloning!
|
||||
if (producer.Owner != self.Owner || producer.Info.HasTraitInfo<ClonesProducedUnitsInfo>())
|
||||
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
new FactionInit(BuildableInfo.GetInitialFaction(produced.Info, faction))
|
||||
};
|
||||
|
||||
production.Produce(self, produced.Info, inits);
|
||||
production.Produce(self, produced.Info, productionType, inits);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.Mods.Common;
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public override bool Produce(Actor self, ActorInfo producee, TypeDictionary inits)
|
||||
public override bool Produce(Actor self, ActorInfo producee, string productionType, TypeDictionary inits)
|
||||
{
|
||||
var owner = self.Owner;
|
||||
var aircraftInfo = self.World.Map.Rules.Actors[info.ActorType].TraitInfo<AircraftInfo>();
|
||||
@@ -80,7 +80,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
foreach (var cargo in self.TraitsImplementing<INotifyDelivery>())
|
||||
cargo.Delivered(self);
|
||||
|
||||
self.World.AddFrameEndTask(ww => DoProduction(self, producee, exit, inits));
|
||||
self.World.AddFrameEndTask(ww => DoProduction(self, producee, exit, productionType, inits));
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.ReadyAudio, self.Owner.Faction.InternalName);
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user