From d20182f158bdf2baa91945b437e628a610c71cc3 Mon Sep 17 00:00:00 2001 From: blackhand1001 Date: Fri, 25 Oct 2019 19:46:29 -0400 Subject: [PATCH] Simplify for loop structure now that it only has one check Simplify for loop structure now that it only has one check --- .../Traits/BotModules/McvManagerBotModule.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/BotModules/McvManagerBotModule.cs b/OpenRA.Mods.Common/Traits/BotModules/McvManagerBotModule.cs index e4f12aec7b..59f71a61a2 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/McvManagerBotModule.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/McvManagerBotModule.cs @@ -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; };