diff --git a/OpenRA.Mods.RA/Buildings/Building.cs b/OpenRA.Mods.RA/Buildings/Building.cs index ea0645d84f..015330b3af 100755 --- a/OpenRA.Mods.RA/Buildings/Building.cs +++ b/OpenRA.Mods.RA/Buildings/Building.cs @@ -45,11 +45,13 @@ namespace OpenRA.Mods.RA.Buildings 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++ ) { - var at = world.WorldActor.Trait().GetBuildingAt( new int2( x, y ) ); + var at = bi.GetBuildingAt( new int2( x, y ) ); if( at != null && at.Owner.Stances[ p ] == Stance.Ally && at.Info.Traits.Get().BaseNormal ) nearnessCandidates.Add( new int2( x, y ) ); }