Add property requirements to safe traits
This commit is contained in:
@@ -17,6 +17,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Creates a free duplicate of produced units.")]
|
||||
public class ClonesProducedUnitsInfo : ITraitInfo, Requires<ProductionInfo>, Requires<ExitInfo>
|
||||
{
|
||||
[FieldLoader.Require]
|
||||
[Desc("Uses the \"Cloneable\" trait to determine whether or not we should clone a produced unit.")]
|
||||
public readonly string[] CloneableTypes = { };
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Actors with the \"ClonesProducedUnits\" trait will produce a free duplicate of me.")]
|
||||
public class CloneableInfo : TraitInfo<Cloneable>
|
||||
{
|
||||
[FieldLoader.Require]
|
||||
[Desc("This unit's cloneable type is:")]
|
||||
public readonly string[] Types = { };
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
{
|
||||
class InfiltrateForSupportPowerInfo : ITraitInfo
|
||||
{
|
||||
[ActorReference] public readonly string Proxy = null;
|
||||
[ActorReference, FieldLoader.Require] public readonly string Proxy = null;
|
||||
|
||||
public object Create(ActorInitializer init) { return new InfiltrateForSupportPower(this); }
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Spawn another actor immediately upon death.")]
|
||||
public class LeavesHuskInfo : ITraitInfo
|
||||
{
|
||||
[ActorReference]
|
||||
[ActorReference, FieldLoader.Require]
|
||||
public readonly string HuskActor = null;
|
||||
|
||||
public object Create(ActorInitializer init) { return new LeavesHusk(init, this); }
|
||||
|
||||
Reference in New Issue
Block a user