Work around AI orders to invalid cells.

This commit is contained in:
Paul Chote
2018-03-22 01:51:07 -03:00
committed by abcdefg30
parent 7e94fa8c8a
commit d79d4479c7

View File

@@ -592,6 +592,14 @@ namespace OpenRA.Mods.Common.Traits
public CPos NearestMoveableCell(CPos target, int minRange, int maxRange)
{
// HACK: This entire method is a hack, and needs to be replaced with
// a proper path search that can account for movement layer transitions.
// HACK: Work around code that blindly tries to move to cells in invalid movement layers.
// This will need to change (by removing this method completely as above) before we can
// properly support user-issued orders on to elevated bridges or other interactable custom layers
if (target.Layer != 0)
target = new CPos(target.X, target.Y);
if (CanEnterCell(target))
return target;