Fix rallypoints not showing full target lines

This commit is contained in:
Gustas
2025-03-07 14:01:20 +02:00
parent ec01f63317
commit 7fc415de19
2 changed files with 22 additions and 3 deletions

View File

@@ -1325,9 +1325,11 @@ namespace OpenRA.Mods.Common.Traits
public override IEnumerable<TargetLineNode> TargetLineNodes(Actor self)
{
if (ChildActivity != null)
foreach (var n in ChildActivity.TargetLineNodes(self))
yield return n;
var a = ChildActivity;
for (; a != null; a = a.NextActivity)
if (!a.IsCanceling)
foreach (var n in a.TargetLineNodes(self))
yield return n;
}
}

View File

@@ -1000,6 +1000,23 @@ namespace OpenRA.Mods.Common.Traits
foreach (var cell in rallyPoint)
QueueChild(new AttackMoveActivity(self, () => mobile.MoveTo(cell, 1, evaluateNearestMovableCell: true, targetLineColor: Color.OrangeRed)));
}
public override IEnumerable<Target> GetTargets(Actor self)
{
if (ChildActivity != null)
return ChildActivity.GetTargets(self);
return Target.None;
}
public override IEnumerable<TargetLineNode> TargetLineNodes(Actor self)
{
var a = ChildActivity;
for (; a != null; a = a.NextActivity)
if (!a.IsCanceling)
foreach (var n in a.TargetLineNodes(self))
yield return n;
}
}
Activity ICreationActivity.GetCreationActivity()