diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 7b2ee2870e..83b37ed116 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -318,13 +318,13 @@ namespace OpenRA foreach (var mod in Mod.AllMods) Console.WriteLine("\t{0}: {1} ({2})", mod.Key, mod.Value.Title, mod.Value.Version); - InitializeWithMod(Settings.Game.Mod); + InitializeWithMod(Settings.Game.Mod, args.GetValue("Launch.Replay", null)); if (Settings.Server.DiscoverNatDevices) RunAfterDelay(Settings.Server.NatDiscoveryTimeout, UPnP.TryStoppingNatDiscovery); } - public static void InitializeWithMod(string mod) + public static void InitializeWithMod(string mod, string replay) { // Clear static state if we have switched mods LobbyInfoChanged = () => { }; @@ -396,6 +396,8 @@ namespace OpenRA { modData.LoadScreen.StartGame(); Settings.Save(); + if (!string.IsNullOrEmpty(replay)) + Game.JoinReplay(replay); } } diff --git a/OpenRA.Mods.RA/Widgets/Logic/ModBrowserLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ModBrowserLogic.cs index fb6d96927d..ac8fe155db 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ModBrowserLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ModBrowserLogic.cs @@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic { Ui.CloseWindow(); onSwitch(); - Game.InitializeWithMod(mod); + Game.InitializeWithMod(mod, null); }); } }