remove one of the Move constructors
This commit is contained in:
@@ -462,7 +462,6 @@ namespace OpenRA.Mods.RA.Move
|
||||
public Activity ScriptedMove(int2 cell) { return new Move(cell); }
|
||||
public Activity MoveTo(int2 cell, int nearEnough) { return new Move(cell, nearEnough); }
|
||||
public Activity MoveTo(int2 cell, Actor ignoredActor) { return new Move(cell, ignoredActor); }
|
||||
public Activity MoveWithinRange(Actor target, int range) { return new Move(target, range); }
|
||||
public Activity MoveWithinRange(Target target, int range) { return new Move(target, range); }
|
||||
public Activity MoveTo(Func<List<int2>> pathFunc) { return new Move(pathFunc); }
|
||||
}
|
||||
|
||||
@@ -12,10 +12,10 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Traits.Activities;
|
||||
using OpenRA.FileFormats;
|
||||
|
||||
namespace OpenRA.Mods.RA.Move
|
||||
{
|
||||
@@ -58,15 +58,6 @@ namespace OpenRA.Mods.RA.Move
|
||||
this.ignoreBuilding = ignoreBuilding;
|
||||
}
|
||||
|
||||
public Move( Actor target, int range )
|
||||
{
|
||||
this.getPath = (self,mobile) => self.World.WorldActor.Trait<PathFinder>().FindUnitPathToRange(
|
||||
mobile.toCell, target.Location,
|
||||
range, self );
|
||||
this.destination = null;
|
||||
this.nearEnough = range;
|
||||
}
|
||||
|
||||
public Move(Target target, int range)
|
||||
{
|
||||
this.getPath = (self,mobile) => self.World.WorldActor.Trait<PathFinder>().FindUnitPathToRange(
|
||||
|
||||
@@ -65,10 +65,13 @@ namespace OpenRA.Mods.RA
|
||||
if (order.OrderString == "RepairNear" && CanRepairAt(order.TargetActor) && ShouldRepair())
|
||||
{
|
||||
var mobile = self.Trait<Mobile>();
|
||||
var target = Target.FromOrder(order);
|
||||
|
||||
self.CancelActivity();
|
||||
self.QueueActivity(mobile.MoveWithinRange(order.TargetActor, 1));
|
||||
self.SetTargetLine(Target.FromOrder(order), Color.Green, false);
|
||||
self.QueueActivity(mobile.MoveWithinRange(target, 1));
|
||||
self.QueueActivity(new Repair(order.TargetActor));
|
||||
|
||||
self.SetTargetLine(target, Color.Green, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user