diff --git a/OpenRA.Mods.RA/Buildings/Building.cs b/OpenRA.Mods.RA/Buildings/Building.cs index 7be8e16994..572f836d0d 100755 --- a/OpenRA.Mods.RA/Buildings/Building.cs +++ b/OpenRA.Mods.RA/Buildings/Building.cs @@ -43,29 +43,29 @@ namespace OpenRA.Mods.RA.Buildings return true; var buildingMaxBounds = (CVec)Dimensions; - if( Rules.Info[ buildingName ].Traits.Contains() ) + if (Rules.Info[buildingName].Traits.Contains()) buildingMaxBounds += new CVec(0, 1); - var scanStart = world.ClampToWorld( topLeft - new CVec( Adjacent, Adjacent ) ); + var scanStart = world.ClampToWorld(topLeft - new CVec(Adjacent, Adjacent)); var scanEnd = world.ClampToWorld(topLeft + buildingMaxBounds + new CVec(Adjacent, Adjacent)); var nearnessCandidates = new List(); var bi = world.WorldActor.Trait(); - for( int y = scanStart.Y ; y < scanEnd.Y ; y++ ) - for( int x = scanStart.X ; x < scanEnd.X ; x++ ) + for (var y = scanStart.Y; y < scanEnd.Y; y++) + for (var x = scanStart.X; x < scanEnd.X; x++) { - var at = bi.GetBuildingAt( new CPos( x, y ) ); - if( at != null && at.Owner.Stances[ p ] == Stance.Ally && at.HasTrait() ) - nearnessCandidates.Add( new CPos( x, y ) ); + var at = bi.GetBuildingAt(new CPos(x, y)); + if (at != null && at.Owner.Stances[p] == Stance.Ally && at.HasTrait()) + nearnessCandidates.Add(new CPos(x, y)); } - var buildingTiles = FootprintUtils.Tiles( buildingName, this, topLeft ).ToList(); + var buildingTiles = FootprintUtils.Tiles(buildingName, this, topLeft).ToList(); return nearnessCandidates - .Any( a => buildingTiles - .Any( b => Math.Abs( a.X - b.X ) <= Adjacent - && Math.Abs( a.Y - b.Y ) <= Adjacent ) ); + .Any(a => buildingTiles + .Any(b => Math.Abs(a.X - b.X) <= Adjacent + && Math.Abs(a.Y - b.Y) <= Adjacent)); } }