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:
@@ -202,12 +202,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
cells = cells.Shuffle(world.LocalRandom);
|
cells = cells.Shuffle(world.LocalRandom);
|
||||||
|
|
||||||
foreach (var cell in cells)
|
foreach (var cell in cells)
|
||||||
{
|
if (world.CanPlaceBuilding(cell + offset, actorInfo, bi, null))
|
||||||
if (!world.CanPlaceBuilding(cell + offset, actorInfo, bi, null))
|
return cell;
|
||||||
continue;
|
|
||||||
|
|
||||||
return cell;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user