From 57a3ad8ae297b5b08b3e273915e52726001ca0d6 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Tue, 8 Sep 2020 19:22:54 +0200 Subject: [PATCH] Replace 'inner' with 'move' inside AttackMoveActivity --- .../Activities/Move/AttackMoveActivity.cs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/OpenRA.Mods.Common/Activities/Move/AttackMoveActivity.cs b/OpenRA.Mods.Common/Activities/Move/AttackMoveActivity.cs index 745b9a1fde..da49560729 100644 --- a/OpenRA.Mods.Common/Activities/Move/AttackMoveActivity.cs +++ b/OpenRA.Mods.Common/Activities/Move/AttackMoveActivity.cs @@ -19,18 +19,18 @@ namespace OpenRA.Mods.Common.Activities { public class AttackMoveActivity : Activity { - readonly Func getInner; + readonly Func getMove; readonly bool isAssaultMove; readonly AutoTarget autoTarget; readonly AttackMove attackMove; - bool runningInnerActivity = false; + bool runningMoveActivity = false; int token = Actor.InvalidConditionToken; Target target = Target.Invalid; - public AttackMoveActivity(Actor self, Func getInner, bool assaultMoving = false) + public AttackMoveActivity(Actor self, Func getMove, bool assaultMoving = false) { - this.getInner = getInner; + this.getMove = getMove; autoTarget = self.TraitOrDefault(); attackMove = self.TraitOrDefault(); isAssaultMove = assaultMoving; @@ -54,32 +54,32 @@ namespace OpenRA.Mods.Common.Activities return TickChild(self); // We are currently not attacking, so scan for new targets. - if (autoTarget != null && (ChildActivity == null || runningInnerActivity)) + if (autoTarget != null && (ChildActivity == null || runningMoveActivity)) { - // Use the standard ScanForTarget rate limit while we are running the inner move activity to save performance. + // Use the standard ScanForTarget rate limit while we are running the move activity to save performance. // Override the rate limit if our attack activity has completed so we can immediately acquire a new target instead of moving. - target = autoTarget.ScanForTarget(self, false, true, !runningInnerActivity); + target = autoTarget.ScanForTarget(self, false, true, !runningMoveActivity); - // Cancel the current inner activity and queue attack activities if we find a new target. + // Cancel the current move activity and queue attack activities if we find a new target. if (target.Type != TargetType.Invalid) { - runningInnerActivity = false; + runningMoveActivity = false; ChildActivity?.Cancel(self); foreach (var ab in autoTarget.ActiveAttackBases) QueueChild(ab.GetAttackActivity(self, AttackSource.AttackMove, target, false, false)); } - // Continue with the inner activity (or queue a new one) when there are no targets. + // Continue with the move activity (or queue a new one) when there are no targets. if (ChildActivity == null) { - runningInnerActivity = true; - QueueChild(getInner()); + runningMoveActivity = true; + QueueChild(getMove()); } } - // If the inner activity finished, we have reached our destination and there are no more enemies on our path. - return TickChild(self) && runningInnerActivity; + // If the move activity finished, we have reached our destination and there are no more enemies on our path. + return TickChild(self) && runningMoveActivity; } protected override void OnLastRun(Actor self) @@ -98,7 +98,7 @@ namespace OpenRA.Mods.Common.Activities public override IEnumerable TargetLineNodes(Actor self) { - foreach (var n in getInner().TargetLineNodes(self)) + foreach (var n in getMove().TargetLineNodes(self)) yield return n; yield break;