diff --git a/OpenRA.Mods.Cnc/Activities/Teleport.cs b/OpenRA.Mods.Cnc/Activities/Teleport.cs index fdd6519137..3e14f22610 100644 --- a/OpenRA.Mods.Cnc/Activities/Teleport.cs +++ b/OpenRA.Mods.Cnc/Activities/Teleport.cs @@ -133,7 +133,7 @@ namespace OpenRA.Mods.Cnc.Activities foreach (var tile in self.World.Map.FindTilesInCircle(destination, max)) { if (teleporter.Owner.Shroud.IsExplored(tile) - && (restrictTo == null || (restrictTo != null && restrictTo.Contains(tile))) + && (restrictTo == null || restrictTo.Contains(tile)) && pos.CanEnterCell(tile)) return tile; } diff --git a/OpenRA.Mods.Cnc/FileFormats/BlowfishKeyProvider.cs b/OpenRA.Mods.Cnc/FileFormats/BlowfishKeyProvider.cs index 6cc4ad228e..ed19047f13 100644 --- a/OpenRA.Mods.Cnc/FileFormats/BlowfishKeyProvider.cs +++ b/OpenRA.Mods.Cnc/FileFormats/BlowfishKeyProvider.cs @@ -90,9 +90,8 @@ namespace OpenRA.Mods.Cnc.FileFormats static uint LenBigNum(uint[] n, uint len) { - uint i; - i = len - 1; - while ((i >= 0) && (n[i] == 0)) i--; + var i = len - 1; + while (n[i] == 0) i--; return i + 1; }