From 1927b88a18ddbbd6547c9da407833d7ea8c14e02 Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Sun, 5 Aug 2018 20:05:19 +0200 Subject: [PATCH] Fix issueing superfluous `difficulty` lobby command from mission browser --- .../Widgets/Logic/MissionBrowserLogic.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs index 379aa0fea8..72e245d581 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs @@ -374,11 +374,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (selectedMap.InvalidCustomRules) return; - var orders = new[] { - Order.Command("option gamespeed {0}".F(gameSpeed)), - Order.Command("option difficulty {0}".F(difficulty)), - Order.Command("state {0}".F(Session.ClientState.Ready)) - }; + var orders = new List(); + if (difficulty != null) + orders.Add(Order.Command("option difficulty {0}".F(difficulty))); + + orders.Add(Order.Command("option gamespeed {0}".F(gameSpeed))); + orders.Add(Order.Command("state {0}".F(Session.ClientState.Ready))); var missionData = selectedMap.Rules.Actors["world"].TraitInfoOrDefault(); if (missionData != null && missionData.StartVideo != null && modData.DefaultFileSystem.Exists(missionData.StartVideo))