Add missing self and optional pretick parameters to Queue, QueueChild and PrintActivity methods.
This means sequenceActivities needs to accept self as well.
This commit is contained in:
@@ -53,7 +53,7 @@ namespace OpenRA.Mods.Cnc.Activities
|
||||
return new Wait(20);
|
||||
|
||||
// Add a CloseEnough range of 512 to the Rearm/Repair activities in order to ensure that we're at the host actor
|
||||
return ActivityUtils.SequenceActivities(
|
||||
return ActivityUtils.SequenceActivities(self,
|
||||
new MoveAdjacentTo(self, Target.FromActor(rearmTarget)),
|
||||
movement.MoveTo(self.World.Map.CellContaining(rearmTarget.CenterPosition), rearmTarget),
|
||||
new Rearm(self, rearmTarget, new WDist(512)),
|
||||
@@ -64,7 +64,7 @@ namespace OpenRA.Mods.Cnc.Activities
|
||||
if (minelayer.Minefield.Contains(self.Location) && ShouldLayMine(self, self.Location))
|
||||
{
|
||||
LayMine(self);
|
||||
return ActivityUtils.SequenceActivities(new Wait(20), this); // A little wait after placing each mine, for show
|
||||
return ActivityUtils.SequenceActivities(self, new Wait(20), this); // A little wait after placing each mine, for show
|
||||
}
|
||||
|
||||
if (minelayer.Minefield.Length > 0)
|
||||
@@ -74,7 +74,7 @@ namespace OpenRA.Mods.Cnc.Activities
|
||||
{
|
||||
var p = minelayer.Minefield.Random(self.World.SharedRandom);
|
||||
if (ShouldLayMine(self, p))
|
||||
return ActivityUtils.SequenceActivities(movement.MoveTo(p, 0), this);
|
||||
return ActivityUtils.SequenceActivities(self, movement.MoveTo(p, 0), this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace OpenRA.Mods.Cnc.Activities
|
||||
attack.DoAttack(self, target);
|
||||
|
||||
jumpComplete = true;
|
||||
QueueChild(mobile.VisualMove(self, position, self.World.Map.CenterOfSubCell(destinationCell, destinationSubCell)));
|
||||
QueueChild(self, mobile.VisualMove(self, position, self.World.Map.CenterOfSubCell(destinationCell, destinationSubCell)), true);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace OpenRA.Mods.Cnc.Activities
|
||||
if (!allowMovement || lastVisibleMaxRange == WDist.Zero || lastVisibleMaxRange < lastVisibleMinRange)
|
||||
return NextActivity;
|
||||
|
||||
QueueChild(mobile.MoveWithinRange(target, lastVisibleMinRange, lastVisibleMaxRange, checkTarget.CenterPosition, Color.Red));
|
||||
QueueChild(self, mobile.MoveWithinRange(target, lastVisibleMinRange, lastVisibleMaxRange, checkTarget.CenterPosition, Color.Red), true);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -127,11 +127,11 @@ namespace OpenRA.Mods.Cnc.Activities
|
||||
var desiredFacing = (destination - origin).Yaw.Facing;
|
||||
if (mobile.Facing != desiredFacing)
|
||||
{
|
||||
QueueChild(new Turn(self, desiredFacing));
|
||||
QueueChild(self, new Turn(self, desiredFacing), true);
|
||||
return this;
|
||||
}
|
||||
|
||||
QueueChild(new Leap(self, target, mobile, targetMobile, info.Speed.Length, attack, edible));
|
||||
QueueChild(self, new Leap(self, target, mobile, targetMobile, info.Speed.Length, attack, edible), true);
|
||||
|
||||
// Re-queue the child activities to kill the target if it didn't die in one go
|
||||
return this;
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
if (!string.IsNullOrEmpty(attack.info.ChargeAudio))
|
||||
Game.Sound.Play(SoundType.World, attack.info.ChargeAudio, self.CenterPosition);
|
||||
|
||||
return ActivityUtils.SequenceActivities(new Wait(attack.info.InitialChargeDelay), new ChargeFire(attack, target), this);
|
||||
return ActivityUtils.SequenceActivities(self, new Wait(attack.info.InitialChargeDelay), new ChargeFire(attack, target), this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
attack.DoAttack(self, target);
|
||||
|
||||
return ActivityUtils.SequenceActivities(new Wait(attack.info.ChargeDelay), this);
|
||||
return ActivityUtils.SequenceActivities(self, new Wait(attack.info.ChargeDelay), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user