Updated GOGHandler with new check for RequiredFiles

This commit is contained in:
erri120 2019-11-17 14:46:10 +01:00
parent 76db3cafea
commit ed2a6c5592
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Win32;
@ -66,7 +67,9 @@ namespace Wabbajack.Common
};
game.Game = GameRegistry.Games.Values
.FirstOrDefault(g => g.GOGIDs != null && g.GOGIDs.Contains(game.GameID))?.Game;
.FirstOrDefault(g => g.GOGIDs != null && g.GOGIDs.Contains(game.GameID)
&&
g.RequiredFiles.TrueForAll(s => File.Exists(Path.Combine(game.Path, s))))?.Game;
Games.Add(game);
}