make bot building repair controllable via yaml

This commit is contained in:
Chris Forbes
2011-10-30 16:45:44 +13:00
parent 72c6a428c9
commit 0edda0fb31

View File

@@ -35,6 +35,7 @@ namespace OpenRA.Mods.RA.AI
public readonly int AssignRolesInterval = 20;
public readonly string RallypointTestBuilding = "fact"; // temporary hack to maintain previous rallypoint behavior.
public readonly string[] UnitQueues = { "Vehicle", "Infantry", "Plane" };
public readonly bool ShouldRepairBuildings = true;
string IBotInfo.Name { get { return this.Name; } }
@@ -441,7 +442,7 @@ namespace OpenRA.Mods.RA.AI
{
if (!enabled) return;
if (self.HasTrait<RepairableBuilding>())
if (Info.ShouldRepairBuildings && self.HasTrait<RepairableBuilding>())
if (e.DamageState > DamageState.Light && e.PreviousDamageState <= DamageState.Light)
{
BotDebug("Bot noticed damage {0} {1}->{2}, repairing.",