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);
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user