Add a range check to Repair.

This commit is contained in:
Paul Chote
2016-09-21 18:25:23 +01:00
parent c1e1ee0938
commit 323ed98a15
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);
}