Added support for filtering exits by production type.
This commit is contained in:
@@ -90,7 +90,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var bi = unit.TraitInfo<BuildableInfo>();
|
||||
|
||||
// Some units may request a specific production type, which is ignored if the AllTech cheat is enabled
|
||||
var type = developerMode.AllTech ? Info.Type : bi.BuildAtProductionType ?? Info.Type;
|
||||
var type = developerMode.AllTech ? Info.Type : (bi.BuildAtProductionType ?? Info.Type);
|
||||
|
||||
var producers = self.World.ActorsWithTrait<Production>()
|
||||
.Where(x => x.Actor.Owner == self.Owner
|
||||
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
new FactionInit(BuildableInfo.GetInitialFaction(unit, p.Trait.Faction))
|
||||
};
|
||||
|
||||
if (p.Trait.Produce(p.Actor, unit, inits))
|
||||
if (p.Trait.Produce(p.Actor, unit, type, inits))
|
||||
{
|
||||
FinishProduction();
|
||||
return true;
|
||||
|
||||
@@ -389,7 +389,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
};
|
||||
|
||||
var sp = self.TraitsImplementing<Production>().FirstOrDefault(p => p.Info.Produces.Contains(Info.Type));
|
||||
if (sp != null && !self.IsDisabled() && sp.Produce(self, unit, inits))
|
||||
if (sp != null && !self.IsDisabled() && sp.Produce(self, unit, developerMode.AllTech ? null : Info.Type, inits))
|
||||
{
|
||||
FinishProduction();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user