automatically switch mods when possible

This commit is contained in:
Matthias Mailänder
2015-01-25 13:57:12 +01:00
parent 3bb448b29b
commit e13447e641
3 changed files with 27 additions and 17 deletions

View File

@@ -77,12 +77,19 @@ namespace OpenRA.Mods.Common.LoadScreens
}
// Load a replay directly
var replay = args != null ? args.GetValue("Launch.Replay", null) : null;
if (!string.IsNullOrEmpty(replay))
var replayFilename = args != null ? args.GetValue("Launch.Replay", null) : null;
if (!string.IsNullOrEmpty(replayFilename))
{
var replayMeta = ReplayMetadata.Read(replay);
if (ReplayUtils.CheckReplayCompatibility(replayMeta, Game.LoadShellMap))
Game.JoinReplay(replay);
var replayMeta = ReplayMetadata.Read(replayFilename);
if (ReplayUtils.PromptConfirmReplayCompatibility(replayMeta, Game.LoadShellMap))
Game.JoinReplay(replayFilename);
if (replayMeta != null)
{
var mod = replayMeta.GameInfo.Mod;
if (mod != null && mod != Game.ModData.Manifest.Mod.Id && ModMetadata.AllMods.ContainsKey(mod))
Game.InitializeMod(mod, args);
}
return;
}