Validate order targets when resolving orders.
This commit is contained in:
@@ -1065,6 +1065,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
var orderString = order.OrderString;
|
var orderString = order.OrderString;
|
||||||
if (orderString == "Move")
|
if (orderString == "Move")
|
||||||
{
|
{
|
||||||
|
if (!order.Target.IsValidFor(self))
|
||||||
|
return;
|
||||||
|
|
||||||
var cell = self.World.Map.Clamp(self.World.Map.CellContaining(order.Target.CenterPosition));
|
var cell = self.World.Map.Clamp(self.World.Map.CellContaining(order.Target.CenterPosition));
|
||||||
if (!Info.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
if (!Info.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
||||||
return;
|
return;
|
||||||
@@ -1080,6 +1083,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
}
|
}
|
||||||
else if (orderString == "Land")
|
else if (orderString == "Land")
|
||||||
{
|
{
|
||||||
|
if (!order.Target.IsValidFor(self))
|
||||||
|
return;
|
||||||
|
|
||||||
var cell = self.World.Map.Clamp(self.World.Map.CellContaining(order.Target.CenterPosition));
|
var cell = self.World.Map.Clamp(self.World.Map.CellContaining(order.Target.CenterPosition));
|
||||||
if (!Info.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
if (!Info.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -83,6 +83,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
if (order.OrderString == "AttackMove" || order.OrderString == "AssaultMove")
|
if (order.OrderString == "AttackMove" || order.OrderString == "AssaultMove")
|
||||||
{
|
{
|
||||||
|
if (!order.Target.IsValidFor(self))
|
||||||
|
return;
|
||||||
|
|
||||||
var cell = self.World.Map.Clamp(self.World.Map.CellContaining(order.Target.CenterPosition));
|
var cell = self.World.Map.Clamp(self.World.Map.CellContaining(order.Target.CenterPosition));
|
||||||
if (!Info.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
if (!Info.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -128,6 +128,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (order.OrderString != OrderID)
|
if (order.OrderString != OrderID)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!order.Target.IsValidFor(self))
|
||||||
|
return;
|
||||||
|
|
||||||
if (!order.Queued)
|
if (!order.Queued)
|
||||||
Path.Clear();
|
Path.Clear();
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
if (order.OrderString == "Move")
|
if (order.OrderString == "Move")
|
||||||
{
|
{
|
||||||
|
if (!order.Target.IsValidFor(self))
|
||||||
|
return;
|
||||||
|
|
||||||
var cell = self.World.Map.Clamp(self.World.Map.CellContaining(order.Target.CenterPosition));
|
var cell = self.World.Map.Clamp(self.World.Map.CellContaining(order.Target.CenterPosition));
|
||||||
if (!Info.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
if (!Info.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -112,6 +112,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
if (order.OrderString == "Move")
|
if (order.OrderString == "Move")
|
||||||
{
|
{
|
||||||
|
if (!order.Target.IsValidFor(self))
|
||||||
|
return;
|
||||||
|
|
||||||
var cell = self.World.Map.Clamp(this.self.World.Map.CellContaining(order.Target.CenterPosition));
|
var cell = self.World.Map.Clamp(this.self.World.Map.CellContaining(order.Target.CenterPosition));
|
||||||
if (!Info.LocomotorInfo.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
if (!Info.LocomotorInfo.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -348,6 +348,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
if (order.OrderString == "DeliverUnit")
|
if (order.OrderString == "DeliverUnit")
|
||||||
{
|
{
|
||||||
|
if (!order.Target.IsValidFor(self))
|
||||||
|
return;
|
||||||
|
|
||||||
var cell = self.World.Map.Clamp(self.World.Map.CellContaining(order.Target.CenterPosition));
|
var cell = self.World.Map.Clamp(self.World.Map.CellContaining(order.Target.CenterPosition));
|
||||||
if (!aircraftInfo.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
if (!aircraftInfo.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -143,6 +143,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (order.OrderString != "BeginMinefield" && order.OrderString != "PlaceMinefield" && order.OrderString != "PlaceMine")
|
if (order.OrderString != "BeginMinefield" && order.OrderString != "PlaceMinefield" && order.OrderString != "PlaceMine")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!order.Target.IsValidFor(self))
|
||||||
|
return;
|
||||||
|
|
||||||
var cell = self.World.Map.CellContaining(order.Target.CenterPosition);
|
var cell = self.World.Map.CellContaining(order.Target.CenterPosition);
|
||||||
if (order.OrderString == "BeginMinefield")
|
if (order.OrderString == "BeginMinefield")
|
||||||
minefieldStart = cell;
|
minefieldStart = cell;
|
||||||
|
|||||||
@@ -922,6 +922,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
if (order.OrderString == "Move")
|
if (order.OrderString == "Move")
|
||||||
{
|
{
|
||||||
|
if (!order.Target.IsValidFor(self))
|
||||||
|
return;
|
||||||
|
|
||||||
var cell = self.World.Map.Clamp(this.self.World.Map.CellContaining(order.Target.CenterPosition));
|
var cell = self.World.Map.Clamp(this.self.World.Map.CellContaining(order.Target.CenterPosition));
|
||||||
if (!Info.LocomotorInfo.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
if (!Info.LocomotorInfo.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user