Path planning no longer considers moving friendly units as blockers.

This commit is contained in:
James Dunne
2012-07-05 16:13:42 -05:00
parent 3d8e215598
commit 9c9a16d80e
6 changed files with 32 additions and 8 deletions

View File

@@ -388,4 +388,23 @@ namespace OpenRA.Mods.RA.Move
}
}
}
public static class ActorExtensionsForMove
{
public static bool IsMoving(this Actor self)
{
if (self.IsIdle) return false;
Activity a = self.GetCurrentActivity();
Debug.Assert(a != null);
// Dirty, but it suffices until we do something better:
if (a.GetType() == typeof(Move)) return true;
if (a.GetType() == typeof(MoveAdjacentTo)) return true;
if (a.GetType() == typeof(AttackMove)) return true;
// Not a move:
return false;
}
}
}