add pathspam in debug
This commit is contained in:
@@ -102,6 +102,16 @@ namespace OpenRA.Traits.Activities
|
|||||||
this.nearEnough = 0;
|
this.nearEnough = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<int2> EvalPath( Actor self, Mobile mobile )
|
||||||
|
{
|
||||||
|
var path = getPath(self, mobile).TakeWhile(a => a != mobile.toCell).ToList();
|
||||||
|
|
||||||
|
Log.Write("debug", "EvalPath #{0} {1}",
|
||||||
|
self.ActorID, string.Join(" ", path.Select(a => a.ToString()).ToArray()));
|
||||||
|
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
public IActivity Tick( Actor self )
|
public IActivity Tick( Actor self )
|
||||||
{
|
{
|
||||||
var mobile = self.Trait<Mobile>();
|
var mobile = self.Trait<Mobile>();
|
||||||
@@ -123,7 +133,7 @@ namespace OpenRA.Traits.Activities
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
path = getPath( self, mobile ).TakeWhile( a => a != mobile.toCell ).ToList();
|
path = EvalPath(self, mobile);
|
||||||
SanityCheckPath( mobile );
|
SanityCheckPath( mobile );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,7 +231,7 @@ namespace OpenRA.Traits.Activities
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
mobile.RemoveInfluence();
|
mobile.RemoveInfluence();
|
||||||
var newPath = getPath( self, mobile ).TakeWhile(a => a != mobile.toCell).ToList();
|
var newPath = EvalPath(self, mobile);
|
||||||
mobile.AddInfluence();
|
mobile.AddInfluence();
|
||||||
|
|
||||||
if (newPath.Count != 0)
|
if (newPath.Count != 0)
|
||||||
|
|||||||
@@ -66,17 +66,21 @@ namespace OpenRA.Traits
|
|||||||
public int InitialFacing { get { return Info.InitialFacing; } }
|
public int InitialFacing { get { return Info.InitialFacing; } }
|
||||||
|
|
||||||
int2 __fromCell, __toCell;
|
int2 __fromCell, __toCell;
|
||||||
|
|
||||||
|
[Sync]
|
||||||
public int2 fromCell
|
public int2 fromCell
|
||||||
{
|
{
|
||||||
get { return __fromCell; }
|
get { return __fromCell; }
|
||||||
set { SetLocation( value, __toCell ); }
|
set { SetLocation( value, __toCell ); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Sync]
|
[Sync]
|
||||||
public int2 toCell
|
public int2 toCell
|
||||||
{
|
{
|
||||||
get { return __toCell; }
|
get { return __toCell; }
|
||||||
set { SetLocation( __fromCell, value ); }
|
set { SetLocation( __fromCell, value ); }
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetLocation( int2 from, int2 to )
|
void SetLocation( int2 from, int2 to )
|
||||||
{
|
{
|
||||||
if( fromCell == from && toCell == to ) return;
|
if( fromCell == from && toCell == to ) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user