Skip to content

Commit

Permalink
Simplify game name check
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Sep 26, 2021
1 parent 03cf0dd commit 62e1856
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/Core_Sideloader/Core.Sideloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,20 +134,7 @@ private void LoadModsFromDirectories(params string[] modDirectories)
if (Manifest.TryLoadFromZip(archive, out Manifest manifest))
{
//Skip the mod if it is not for this game
bool allowed = false;
if (manifest.Games.Count == 0)
allowed = true;
else
{
foreach (var gameName in manifest.Games)
{
if (GameNameList.Contains(gameName.ToLower()))
{
allowed = true;
break;
}
}
}
bool allowed = manifest.Games.Count == 0 || manifest.Games.Select(x => x.ToLower()).Any(GameNameList.Contains);
if (!allowed)
{
Logger.LogInfo($"Skipping archive \"{GetRelativeArchiveDir(archivePath)}\" because it's meant for {string.Join(", ", manifest.Games.ToArray())}");
Expand Down Expand Up @@ -313,7 +300,7 @@ private void LoadAllLists(ZipFile arc, Manifest manifest)
#endif
#endif
}

#if KK || AI || HS2 || KKS
//ItemBoneList data must be resolved after the corresponding item so they can be resolved to the same ID
foreach (ZipEntry entry in BoneList)
Expand Down

0 comments on commit 62e1856

Please sign in to comment.