Disable lane bias on gunboat and lst

This commit is contained in:
Paul Chote
2010-08-21 21:40:52 +12:00
parent c35e3b4bd7
commit f38e4d27be
3 changed files with 30 additions and 7 deletions

View File

@@ -61,13 +61,19 @@ namespace OpenRA
return this;
}
public PathSearch WithoutLaneBias()
{
LaneBias = 0f;
return this;
}
public PathSearch FromPoint(int2 from)
{
AddInitialCell( self.World, from );
return this;
}
const float LaneBias = .5f;
float LaneBias = .5f;
public int2 Expand( World world )
{

View File

@@ -37,6 +37,19 @@ namespace OpenRA.Traits.Activities
Game.world.SharedRandom.Next(-spreadTicksBeforePathing, spreadTicksBeforePathing);
}
// Scriptable move order
// Ignores lane bias and nearby units
public Move( int2 destination )
: this()
{
this.getPath = (self,mobile) =>
self.World.PathFinder.FindPath(
PathSearch.FromPoint( self, mobile.toCell, destination, false )
.WithoutLaneBias());
this.destination = destination;
this.nearEnough = 0;
}
public Move( int2 destination, int nearEnough )
: this()
{
@@ -45,7 +58,7 @@ namespace OpenRA.Traits.Activities
this.destination = destination;
this.nearEnough = nearEnough;
}
public Move(int2 destination, Actor ignoreBuilding)
: this()
{