From a9e5744a377f30b72b9c9e3b63d43eef01e7a34d Mon Sep 17 00:00:00 2001 From: Gustas <37534529+PunkPun@users.noreply.github.com> Date: Sat, 14 Sep 2024 23:00:23 +0300 Subject: [PATCH] Fix opening up skirmish menu making it impossible to leave map editor --- .../Widgets/Logic/Ingame/IngameMenuLogic.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs index ab65c14a2d..8b38d0d8eb 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs @@ -251,6 +251,16 @@ namespace OpenRA.Mods.Common.Widgets.Logic var iop = world.WorldActor.TraitsImplementing().FirstOrDefault(); var exitDelay = iop?.ExitDelay ?? 0; var mpe = world.WorldActor.TraitOrDefault(); + + // HACK: Opening up skirmish menu can mess up the OrderManager. + if (!Game.IsCurrentWorld(world)) + { + Game.Disconnect(); + Ui.ResetAll(); + Game.LoadShellMap(); + return; + } + if (mpe != null) { Game.RunAfterDelay(exitDelay, () =>