Merge pull request #12085 from pchote/repair-range-check

Add a range check to Repair.
This commit is contained in:
RoosterDragon
2016-09-23 18:56:24 +01:00
committed by GitHub
5 changed files with 20 additions and 14 deletions

View File

@@ -341,7 +341,7 @@ namespace OpenRA.Mods.Common.Traits
if (Info.RearmBuildings.Contains(name))
yield return new Rearm(self);
if (Info.RepairBuildings.Contains(name))
yield return new Repair(a);
yield return new Repair(self, a);
}
public void ModifyDeathActorInit(Actor self, TypeDictionary init)

View File

@@ -114,7 +114,7 @@ namespace OpenRA.Mods.Common.Traits
if (CanRearmAt(order.TargetActor) && CanRearm())
self.QueueActivity(new Rearm(self));
self.QueueActivity(new Repair(order.TargetActor));
self.QueueActivity(new Repair(self, order.TargetActor));
var rp = order.TargetActor.TraitOrDefault<RallyPoint>();
if (rp != null)

View File

@@ -79,7 +79,7 @@ namespace OpenRA.Mods.Common.Traits
self.CancelActivity();
self.QueueActivity(movement.MoveWithinRange(target, info.CloseEnough));
self.QueueActivity(new Repair(order.TargetActor));
self.QueueActivity(new Repair(self, order.TargetActor, info.CloseEnough));
self.SetTargetLine(target, Color.Green, false);
}