sync the last path generated, to try and catch this MUCH earlier
This commit is contained in:
@@ -102,6 +102,16 @@ namespace OpenRA.Traits.Activities
|
||||
this.nearEnough = 0;
|
||||
}
|
||||
|
||||
static int HashList<T>(List<T> xs)
|
||||
{
|
||||
int hash = 0;
|
||||
int n = 0;
|
||||
foreach (var x in xs)
|
||||
hash += n++ * x.GetHashCode();
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
List<int2> EvalPath( Actor self, Mobile mobile )
|
||||
{
|
||||
var path = getPath(self, mobile).TakeWhile(a => a != mobile.toCell).ToList();
|
||||
@@ -109,6 +119,8 @@ namespace OpenRA.Traits.Activities
|
||||
Log.Write("debug", "EvalPath #{0} {1}",
|
||||
self.ActorID, string.Join(" ", path.Select(a => a.ToString()).ToArray()));
|
||||
|
||||
mobile.PathHash = HashList(path);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user