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

@@ -33,8 +33,9 @@ namespace OpenRA.Mods.Common.Scripting
}
[ScriptActorPropertyActivity]
[Desc("Build a unit, ignoring the production queue. The activity will wait if the exit is blocked.")]
public void Produce(string actorType, string factionVariant = null)
[Desc("Build a unit, ignoring the production queue. The activity will wait if the exit is blocked.",
"If productionType is nil or unavailable, then an exit will be selected based on Buildable info.")]
public void Produce(string actorType, string factionVariant = null, string productionType = null)
{
ActorInfo actorInfo;
if (!Self.World.Map.Rules.Actors.TryGetValue(actorType, out actorInfo))
@@ -47,7 +48,7 @@ namespace OpenRA.Mods.Common.Scripting
new FactionInit(faction)
};
Self.QueueActivity(new WaitFor(() => p.Produce(Self, actorInfo, inits)));
Self.QueueActivity(new WaitFor(() => p.Produce(Self, actorInfo, productionType, inits)));
}
}

View File

@@ -404,7 +404,7 @@ namespace OpenRA.Mods.Common.Scripting
}
}
public void UnitProducedByOther(Actor self, Actor producee, Actor produced)
public void UnitProducedByOther(Actor self, Actor producee, Actor produced, string productionType)
{
if (world.Disposing)
return;