Simplify for loop structure now that it only has one check

Simplify for loop structure now that it only has one check
This commit is contained in:
blackhand1001
2019-10-25 19:46:29 -04:00
committed by abcdefg30
parent 49d07e9d64
commit d20182f158

View File

@@ -202,12 +202,8 @@ namespace OpenRA.Mods.Common.Traits
cells = cells.Shuffle(world.LocalRandom);
foreach (var cell in cells)
{
if (!world.CanPlaceBuilding(cell + offset, actorInfo, bi, null))
continue;
return cell;
}
if (world.CanPlaceBuilding(cell + offset, actorInfo, bi, null))
return cell;
return null;
};