Merge pull request #12030 from pchote/fix-tfd-detection

Work around incorrect mono drive detection under OSX.
This commit is contained in:
Oliver Brakmann
2016-09-17 18:22:27 +02:00
committed by GitHub

View File

@@ -96,6 +96,18 @@ namespace OpenRA.Mods.Common.Widgets.Logic
DetectContentDisks();
}
static bool IsValidDrive(DriveInfo d)
{
if (d.DriveType == DriveType.CDRom && d.IsReady)
return true;
// HACK: the "TFD" DVD is detected as a fixed udf-formatted drive on OSX
if (d.DriveType == DriveType.Fixed && d.DriveFormat == "udf")
return true;
return false;
}
void DetectContentDisks()
{
var message = "Detecting drives";
@@ -105,7 +117,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
new Task(() =>
{
var volumes = DriveInfo.GetDrives()
.Where(v => v.DriveType == DriveType.CDRom && v.IsReady)
.Where(IsValidDrive)
.Select(v => v.RootDirectory.FullName);
foreach (var kv in sources)