Validate order targets when resolving orders.
This commit is contained in:
@@ -128,6 +128,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (order.OrderString != OrderID)
|
||||
return;
|
||||
|
||||
if (!order.Target.IsValidFor(self))
|
||||
return;
|
||||
|
||||
if (!order.Queued)
|
||||
Path.Clear();
|
||||
|
||||
|
||||
@@ -121,6 +121,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
if (order.OrderString == "Move")
|
||||
{
|
||||
if (!order.Target.IsValidFor(self))
|
||||
return;
|
||||
|
||||
var cell = self.World.Map.Clamp(self.World.Map.CellContaining(order.Target.CenterPosition));
|
||||
if (!Info.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
||||
return;
|
||||
|
||||
@@ -112,6 +112,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
if (order.OrderString == "Move")
|
||||
{
|
||||
if (!order.Target.IsValidFor(self))
|
||||
return;
|
||||
|
||||
var cell = self.World.Map.Clamp(this.self.World.Map.CellContaining(order.Target.CenterPosition));
|
||||
if (!Info.LocomotorInfo.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user