diff --git a/OpenRa.Game/Orders/ChronoshiftDestinationOrderGenerator.cs b/OpenRa.Game/Orders/ChronoshiftDestinationOrderGenerator.cs index e85e248752..a2cd5ef75f 100644 --- a/OpenRa.Game/Orders/ChronoshiftDestinationOrderGenerator.cs +++ b/OpenRa.Game/Orders/ChronoshiftDestinationOrderGenerator.cs @@ -35,6 +35,9 @@ namespace OpenRa.Game.Orders public Cursor GetCursor(int2 xy, MouseInput mi) { + if (!Game.LocalPlayer.Shroud.IsExplored(xy)) + return Cursor.MoveBlocked; + var movement = self.traits.WithInterface().FirstOrDefault(); return (movement.CanEnterCell(xy)) ? Cursor.Chronoshift : Cursor.MoveBlocked; } diff --git a/OpenRa.Game/Shroud.cs b/OpenRa.Game/Shroud.cs index 8f64f7365c..56cc9efb59 100644 --- a/OpenRa.Game/Shroud.cs +++ b/OpenRa.Game/Shroud.cs @@ -14,6 +14,11 @@ namespace OpenRa.Game Sprite[,] sprites = new Sprite[128, 128]; bool dirty; + public bool IsExplored(int2 xy) + { + return explored[ xy.X, xy.Y ]; + } + public void Explore(Actor a) { foreach (var t in Game.FindTilesInCircle((1f / Game.CellSize * a.CenterLocation).ToInt2(), a.Info.Sight)) diff --git a/OpenRa.Game/Traits/Chronoshiftable.cs b/OpenRa.Game/Traits/Chronoshiftable.cs index bf97b15542..cd0fa8af1c 100644 --- a/OpenRa.Game/Traits/Chronoshiftable.cs +++ b/OpenRa.Game/Traits/Chronoshiftable.cs @@ -46,7 +46,10 @@ namespace OpenRa.Game.Traits var movement = self.traits.WithInterface().FirstOrDefault(); if (order.OrderString == "Chronoshift" && movement.CanEnterCell(order.TargetLocation)) { - + // Cannot chronoshift into unexplored location + if (!Game.LocalPlayer.Shroud.IsExplored(order.TargetLocation)) + return; + // Set up return-to-sender info chronoshiftOrigin = self.Location; chronoshiftReturnTicks = (int)(Rules.General.ChronoDuration * 60 * 25);