Using MO2Name instead of MO2ArchiveName for GameFileSourceDownloader

This commit is contained in:
erri120 2021-01-26 16:14:04 +01:00
parent 4a32fc1415
commit d9902746d0
2 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,21 @@
using System.Linq;
using Xunit;
namespace Wabbajack.Common.Test
{
public class GameTests
{
[Fact]
public void TestGetGameFromMO2ArchiveName()
{
var games = GameRegistry.Games.Select(x => (name: x.Value.MO2Name, game: x.Key));
foreach (var (name, game) in games)
{
if (name == null) continue;
var result = GameRegistry.TryGetByFuzzyName(name);
Assert.NotNull(result);
Assert.Equal(game, result.Game);
}
}
}
}

View File

@ -99,7 +99,9 @@ namespace Wabbajack.Lib.Downloaders
public override string[] GetMetaIni()
{
var meta = Game.MetaData();
return new[] {"[General]", $"gameName={meta.MO2ArchiveName ?? meta.Game.ToString()}", $"gameFile={GameFile}"};
//using MO2Name instead of MO2ArchiveName because Skyrim VR and Fallout 4 VR have the same archive name
//as their non-vr counterpart.
return new[] {"[General]", $"gameName={meta.MO2Name ?? meta.Game.ToString()}", $"gameFile={GameFile}"};
}
}