Harvester now autoharvest when produced

This commit is contained in:
abcdefg30
2014-10-01 21:27:07 +02:00
parent d7be83dcd7
commit d1e9d7d19d
6 changed files with 11 additions and 0 deletions

View File

@@ -33,6 +33,9 @@ namespace OpenRA.Mods.RA
[Desc("Disable production when there are more than this many of this actor on the battlefield. Set to 0 to disable.")]
public readonly int BuildLimit = 0;
[Desc("What the unit should start doing. Warning: If this is not a harvester", "it will break if you use FindResources.")]
public readonly string InitialActivity = null;
// TODO: UI fluff; doesn't belong here
public readonly int BuildPaletteOrder = 9999;
}

View File

@@ -103,6 +103,10 @@ namespace OpenRA.Mods.RA
foreach (var notify in notifyOthers)
notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit);
var bi = newUnit.Info.Traits.GetOrDefault<BuildableInfo>();
if (bi != null && bi.InitialActivity != null)
newUnit.QueueActivity(Game.CreateObject<Activity>(bi.InitialActivity));
});
}