diff --git a/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs b/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs index 572d5c4922..9db064c7f1 100644 --- a/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs +++ b/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs @@ -50,7 +50,11 @@ namespace BizHawk.Client.Common string line; while ((line = reader.ReadLine()) != null) { - if (line.Contains("Frame ")) + if (line.StartsWith("|")) + { + Log.Add(line); + } + else if (line.StartsWith("Frame ")) { var strs = line.Split(' '); try @@ -67,10 +71,6 @@ namespace BizHawk.Client.Common { LogKey = line.Replace("LogKey:", ""); } - else if (line[0] == '|') - { - Log.Add(line); - } } } else @@ -79,7 +79,12 @@ namespace BizHawk.Client.Common string line; while ((line = reader.ReadLine()) != null) { - if (line.Contains("Frame ")) + if (line.StartsWith("|")) + { + SetFrameAt(i, line); + i++; + } + else if (line.StartsWith("Frame ")) { var strs = line.Split(' '); try @@ -96,11 +101,6 @@ namespace BizHawk.Client.Common { LogKey = line.Replace("LogKey:", ""); } - else if (line.StartsWith("|")) - { - SetFrameAt(i, line); - i++; - } } } @@ -145,12 +145,11 @@ namespace BizHawk.Client.Common string line; while ((line = reader.ReadLine()) != null) { - if (line.Trim() == "") + if (line.StartsWith("|")) { - continue; + newLog.Add(line); } - - if (line.Contains("Frame ")) + else if (line.StartsWith("Frame ")) { var strs = line.Split(' '); try @@ -163,10 +162,6 @@ namespace BizHawk.Client.Common return false; } } - else if (line[0] == '|') - { - newLog.Add(line); - } } if (stateFrame == 0) diff --git a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs index cf04f59971..48bd345718 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs @@ -194,7 +194,17 @@ namespace BizHawk.Client.Common string line; while ((line = reader.ReadLine()) != null) { - if (line.Contains("Frame ")) + if (line.StartsWith("|")) + { + newLog.Add(line); + if (!timelineBranchFrame.HasValue && counter < Log.Count && line != Log[counter]) + { + timelineBranchFrame = counter; + } + + counter++; + } + else if (line.StartsWith("Frame ")) { var split = line.Split(' '); try @@ -211,16 +221,6 @@ namespace BizHawk.Client.Common { LogKey = line.Replace("LogKey:", ""); } - else if (line[0] == '|') - { - newLog.Add(line); - if (!timelineBranchFrame.HasValue && counter < Log.Count && line != Log[counter]) - { - timelineBranchFrame = counter; - } - - counter++; - } } Log.Clear();