From 3c216aa309f09787b375e6275cda4631f0cd3714 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 21 Jul 2018 17:02:51 -0700 Subject: [PATCH] More accurate detection --- DICUI/Utilities/DumpEnvironment.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/DICUI/Utilities/DumpEnvironment.cs b/DICUI/Utilities/DumpEnvironment.cs index 34310401..e9108847 100644 --- a/DICUI/Utilities/DumpEnvironment.cs +++ b/DICUI/Utilities/DumpEnvironment.cs @@ -989,7 +989,16 @@ namespace DICUI.Utilities try { // Fast forward to the layerbreak - while (!sr.ReadLine().Trim().StartsWith("========== SectorLength ==========")) ; + string line = sr.ReadLine(); + while (line != null) + { + // We definitely found a single-layer disc + if (line.Contains("NumberOfLayers: Single Layer")) + return null; + else if (line.Trim().StartsWith("========== SectorLength ==========")) + break; + line = sr.ReadLine(); + } // Now that we're at the layerbreak line, attempt to get the decimal version return sr.ReadLine().Trim().Split(' ')[1];