Make Tick return bool
This commit is contained in:
@@ -83,10 +83,10 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return target.Recalculate(self.Owner, out targetIsHiddenActor);
|
||||
}
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
public override bool Tick(Actor self)
|
||||
{
|
||||
if (IsCanceling)
|
||||
return NextActivity;
|
||||
return true;
|
||||
|
||||
bool targetIsHiddenActor;
|
||||
target = RecalculateTarget(self, out targetIsHiddenActor);
|
||||
@@ -106,7 +106,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
// If we are ticking again after previously sequencing a MoveWithRange then that move must have completed
|
||||
// Either we are in range and can see the target, or we've lost track of it and should give up
|
||||
if (wasMovingWithinRange && targetIsHiddenActor)
|
||||
return NextActivity;
|
||||
return true;
|
||||
|
||||
// Update target lines if required
|
||||
if (useLastVisibleTarget != oldUseLastVisibleTarget)
|
||||
@@ -114,7 +114,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
// Target is hidden or dead, and we don't have a fallback position to move towards
|
||||
if (useLastVisibleTarget && !lastVisibleTarget.IsValidFor(self))
|
||||
return NextActivity;
|
||||
return true;
|
||||
|
||||
wasMovingWithinRange = false;
|
||||
var pos = self.CenterPosition;
|
||||
@@ -125,12 +125,12 @@ namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
// We've reached the assumed position but it is not there or we can't move any further - give up
|
||||
if (checkTarget.IsInRange(pos, lastVisibleMaximumRange) || move == null || lastVisibleMaximumRange == WDist.Zero)
|
||||
return NextActivity;
|
||||
return true;
|
||||
|
||||
// Move towards the last known position
|
||||
wasMovingWithinRange = true;
|
||||
QueueChild(move.MoveWithinRange(target, WDist.Zero, lastVisibleMaximumRange, checkTarget.CenterPosition, Color.Red));
|
||||
return this;
|
||||
return false;
|
||||
}
|
||||
|
||||
attackStatus = AttackStatus.UnableToAttack;
|
||||
@@ -145,9 +145,9 @@ namespace OpenRA.Mods.Common.Activities
|
||||
wasMovingWithinRange = true;
|
||||
|
||||
if (attackStatus >= AttackStatus.NeedsToTurn)
|
||||
return this;
|
||||
return false;
|
||||
|
||||
return NextActivity;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected virtual AttackStatus TickAttack(Actor self, AttackFrontal attack)
|
||||
|
||||
Reference in New Issue
Block a user