Validate order targets when resolving orders.
This commit is contained in:
@@ -1065,6 +1065,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var orderString = order.OrderString;
|
||||
if (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;
|
||||
@@ -1080,6 +1083,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
else if (orderString == "Land")
|
||||
{
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user