Always make sure to be on the host actor when repairing

This commit is contained in:
abcdefg30
2017-05-26 09:49:17 +02:00
committed by reaperrr
parent 2e0d7d0e79
commit 1f93029e51
4 changed files with 8 additions and 7 deletions

View File

@@ -391,8 +391,10 @@ namespace OpenRA.Mods.Common.Traits
var name = a.Info.Name;
if (Info.RearmBuildings.Contains(name))
yield return new Rearm(self);
// Add a CloseEnough range of 512 to ensure we're at the host actor
if (Info.RepairBuildings.Contains(name))
yield return new Repair(self, a);
yield return new Repair(self, a, new WDist(512));
}
public void ModifyDeathActorInit(Actor self, TypeDictionary init)

View File

@@ -114,7 +114,8 @@ namespace OpenRA.Mods.Common.Traits
if (CanRearmAt(order.TargetActor) && CanRearm())
self.QueueActivity(new Rearm(self));
self.QueueActivity(new Repair(self, order.TargetActor));
// Add a CloseEnough range of 512 to ensure we're at the host actor
self.QueueActivity(new Repair(self, order.TargetActor, new WDist(512)));
var rp = order.TargetActor.TraitOrDefault<RallyPoint>();
if (rp != null)