Helicopters use pathfinder

This commit is contained in:
Paul Chote
2010-06-24 21:44:30 +12:00
parent 37cf30a097
commit 0aeca2aadc
12 changed files with 75 additions and 53 deletions

View File

@@ -167,7 +167,7 @@ namespace OpenRA.Traits.Activities
{
if( path.Count == 0 ) return null;
var nextCell = path[ path.Count - 1 ];
if( !mobile.CanEnterCell( nextCell, ignoreBuilding ) )
if( !mobile.CanEnterCell( nextCell, ignoreBuilding, true ) )
{
if( ( mobile.toCell - destination.Value ).LengthSquared <= nearEnough )
{
@@ -185,10 +185,13 @@ namespace OpenRA.Traits.Activities
if (--waitTicksRemaining >= 0)
return null;
self.World.WorldActor.traits.Get<UnitInfluence>().Remove( self, mobile );
//self.World.WorldActor.traits.Get<UnitInfluence>().Remove( self, mobile );
mobile.RemoveInfluence();
var newPath = getPath(self).TakeWhile(a => a != self.Location).ToList();
self.World.WorldActor.traits.Get<UnitInfluence>().Add( self, mobile );
//self.World.WorldActor.traits.Get<UnitInfluence>().Add( self, mobile );
mobile.AddInfluence();
if (newPath.Count != 0)
path = newPath;