Remove unused parameters.
This commit is contained in:
committed by
abcdefg30
parent
ea243b8558
commit
0e7ad43425
@@ -91,7 +91,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return false;
|
||||
|
||||
target = target.Recalculate(self.Owner, out var targetIsHiddenActor);
|
||||
attackAircraft.SetRequestedTarget(self, target, forceAttack);
|
||||
attackAircraft.SetRequestedTarget(target, forceAttack);
|
||||
hasTicked = true;
|
||||
|
||||
if (!targetIsHiddenActor && target.Type == TargetType.Actor)
|
||||
@@ -171,9 +171,9 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
// The aircraft must keep moving forward even if it is already in an ideal position.
|
||||
else if (attackAircraft.Info.AttackType == AirAttackType.Strafe)
|
||||
QueueChild(new StrafeAttackRun(self, attackAircraft, aircraft, target, strafeDistance != WDist.Zero ? strafeDistance : lastVisibleMaximumRange));
|
||||
QueueChild(new StrafeAttackRun(attackAircraft, aircraft, target, strafeDistance != WDist.Zero ? strafeDistance : lastVisibleMaximumRange));
|
||||
else if (attackAircraft.Info.AttackType == AirAttackType.Default && !aircraft.Info.CanHover)
|
||||
QueueChild(new FlyAttackRun(self, target, lastVisibleMaximumRange, attackAircraft));
|
||||
QueueChild(new FlyAttackRun(target, lastVisibleMaximumRange, attackAircraft));
|
||||
|
||||
// Turn to face the target if required.
|
||||
else if (!attackAircraft.TargetInFiringArc(self, target, attackAircraft.Info.FacingTolerance))
|
||||
@@ -220,7 +220,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
Target target;
|
||||
bool targetIsVisibleActor;
|
||||
|
||||
public FlyAttackRun(Actor self, in Target t, WDist exitRange, AttackAircraft attack)
|
||||
public FlyAttackRun(in Target t, WDist exitRange, AttackAircraft attack)
|
||||
{
|
||||
ChildHasPriority = false;
|
||||
|
||||
@@ -269,7 +269,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
Target target;
|
||||
|
||||
public StrafeAttackRun(Actor self, AttackAircraft attackAircraft, Aircraft aircraft, in Target t, WDist exitRange)
|
||||
public StrafeAttackRun(AttackAircraft attackAircraft, Aircraft aircraft, in Target t, WDist exitRange)
|
||||
{
|
||||
ChildHasPriority = false;
|
||||
|
||||
@@ -304,7 +304,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
// Update the position if we seen the target move; keep the previous one if it dies or disappears
|
||||
target = target.Recalculate(self.Owner, out var targetIsHiddenActor);
|
||||
if (!targetIsHiddenActor && target.Type == TargetType.Actor)
|
||||
attackAircraft.SetRequestedTarget(self, Target.FromTargetPositions(target), true);
|
||||
attackAircraft.SetRequestedTarget(Target.FromTargetPositions(target), true);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
protected override void OnFirstRun(Actor self)
|
||||
{
|
||||
if (targetActor != null && targetActor.IsInWorld)
|
||||
harv.LinkProc(self, targetActor);
|
||||
harv.LinkProc(targetActor);
|
||||
}
|
||||
|
||||
public override bool Tick(Actor self)
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
self.Trait<Aircraft>().RemoveInfluence();
|
||||
|
||||
var localOffset = carryall.CarryableOffset.Rotate(body.QuantizeOrientation(self, self.Orientation));
|
||||
var localOffset = carryall.CarryableOffset.Rotate(body.QuantizeOrientation(self.Orientation));
|
||||
var targetPosition = self.CenterPosition + body.LocalToWorld(localOffset);
|
||||
var targetLocation = self.World.Map.CellContaining(targetPosition);
|
||||
carryall.Carryable.Trait<IPositionable>().SetPosition(carryall.Carryable, targetLocation, SubCell.FullCell);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
if (IsCanceling || (deploy.DeployState != DeployState.Deployed && moving))
|
||||
return true;
|
||||
|
||||
QueueChild(new DeployInner(self, deploy));
|
||||
QueueChild(new DeployInner(deploy));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
readonly GrantConditionOnDeploy deployment;
|
||||
bool initiated;
|
||||
|
||||
public DeployInner(Actor self, GrantConditionOnDeploy deployment)
|
||||
public DeployInner(GrantConditionOnDeploy deployment)
|
||||
{
|
||||
this.deployment = deployment;
|
||||
|
||||
|
||||
@@ -159,19 +159,19 @@ namespace OpenRA.Mods.Common.Activities
|
||||
// Harvesters should respect an explicit harvest order instead of harvesting the current cell.
|
||||
if (orderLocation == null)
|
||||
{
|
||||
if (harv.CanHarvestCell(self, self.Location) && claimLayer.CanClaimCell(self, self.Location))
|
||||
if (harv.CanHarvestCell(self.Location) && claimLayer.CanClaimCell(self, self.Location))
|
||||
return self.Location;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (harv.CanHarvestCell(self, orderLocation.Value) && claimLayer.CanClaimCell(self, orderLocation.Value))
|
||||
if (harv.CanHarvestCell(orderLocation.Value) && claimLayer.CanClaimCell(self, orderLocation.Value))
|
||||
return orderLocation;
|
||||
|
||||
orderLocation = null;
|
||||
}
|
||||
|
||||
// Determine where to search from and how far to search:
|
||||
var procLoc = GetSearchFromProcLocation(self);
|
||||
var procLoc = GetSearchFromProcLocation();
|
||||
var searchFromLoc = lastHarvestedCell ?? procLoc ?? self.Location;
|
||||
var searchRadius = lastHarvestedCell.HasValue ? harvInfo.SearchFromHarvesterRadius : harvInfo.SearchFromProcRadius;
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
using (var search = PathSearch.ToTargetCellByPredicate(
|
||||
self.World, mobile.Locomotor, self, new[] { searchFromLoc, self.Location },
|
||||
loc =>
|
||||
harv.CanHarvestCell(self, loc) &&
|
||||
harv.CanHarvestCell(loc) &&
|
||||
claimLayer.CanClaimCell(self, loc),
|
||||
BlockedByActor.Stationary,
|
||||
loc =>
|
||||
@@ -196,7 +196,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
// Add a cost modifier to harvestable cells to prefer resources that are closer to the refinery.
|
||||
// This reduces the tendency for harvesters to move in straight lines
|
||||
if (procPos.HasValue && harvInfo.ResourceRefineryDirectionPenalty > 0 && harv.CanHarvestCell(self, loc))
|
||||
if (procPos.HasValue && harvInfo.ResourceRefineryDirectionPenalty > 0 && harv.CanHarvestCell(loc))
|
||||
{
|
||||
var pos = map.CenterOfCell(loc);
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
yield return new TargetLineNode(Target.FromActor(deliverActor), harvInfo.DeliverLineColor);
|
||||
}
|
||||
|
||||
CPos? GetSearchFromProcLocation(Actor self)
|
||||
CPos? GetSearchFromProcLocation()
|
||||
{
|
||||
if (harv.LastLinkedProc != null && !harv.LastLinkedProc.IsDead && harv.LastLinkedProc.IsInWorld)
|
||||
return harv.LastLinkedProc.Location + harv.LastLinkedProc.Trait<IAcceptResources>().DeliveryOffset;
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!harv.CanHarvestCell(self, self.Location))
|
||||
if (!harv.CanHarvestCell(self.Location))
|
||||
return true;
|
||||
|
||||
// Turn to one of the harvestable facings
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
case DockingState.Complete:
|
||||
Harv.LastLinkedProc = Harv.LinkedProc;
|
||||
Harv.LinkProc(self, null);
|
||||
Harv.LinkProc(null);
|
||||
if (IsDragRequired)
|
||||
QueueChild(new Drag(self, EndDrag, StartDrag, DragLength));
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
}
|
||||
|
||||
// Can complete the move in this step
|
||||
var speed = mobile.MovementSpeedForCell(self, self.Location);
|
||||
var speed = mobile.MovementSpeedForCell(self.Location);
|
||||
if (delta.LengthSquared <= speed * speed)
|
||||
{
|
||||
mobile.SetCenterPosition(self, targetPos);
|
||||
|
||||
@@ -415,7 +415,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
// Only move by a full speed step if we didn't already move this tick.
|
||||
// If we did, we limit the move to any carried-over leftover progress.
|
||||
if (Move.lastMovePartCompletedTick < self.World.WorldTick)
|
||||
progress += mobile.MovementSpeedForCell(self, mobile.ToCell);
|
||||
progress += mobile.MovementSpeedForCell(mobile.ToCell);
|
||||
|
||||
if (progress >= Distance)
|
||||
{
|
||||
@@ -448,13 +448,13 @@ namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
var currentCellOrientation = self.World.Map.TerrainOrientation(mobile.FromCell);
|
||||
var orientation = WRot.SLerp(FromTerrainOrientation.Value, currentCellOrientation, progress, terrainOrientationMargin);
|
||||
mobile.SetTerrainRampOrientation(self, orientation);
|
||||
mobile.SetTerrainRampOrientation(orientation);
|
||||
}
|
||||
else if (ToTerrainOrientation.HasValue && Distance - progress < terrainOrientationMargin)
|
||||
{
|
||||
var currentCellOrientation = self.World.Map.TerrainOrientation(mobile.FromCell);
|
||||
var orientation = WRot.SLerp(ToTerrainOrientation.Value, currentCellOrientation, Distance - progress, terrainOrientationMargin);
|
||||
mobile.SetTerrainRampOrientation(self, orientation);
|
||||
mobile.SetTerrainRampOrientation(orientation);
|
||||
}
|
||||
|
||||
mobile.Facing = WAngle.Lerp(FromFacing, ToFacing, progress, Distance);
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
// Pickup position and facing are now known - swap the fly/wait activity with Land
|
||||
ChildActivity.Cancel(self);
|
||||
|
||||
var localOffset = carryall.OffsetForCarryable(self, cargo).Rotate(carryableBody.QuantizeOrientation(self, cargo.Orientation));
|
||||
var localOffset = carryall.OffsetForCarryable(self, cargo).Rotate(carryableBody.QuantizeOrientation(cargo.Orientation));
|
||||
QueueChild(new Land(self, Target.FromActor(cargo), -carryableBody.LocalToWorld(localOffset), carryableFacing.Facing));
|
||||
|
||||
// Pause briefly before attachment for visual effect
|
||||
|
||||
Reference in New Issue
Block a user