diff --git a/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs b/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs index dfa4dd11ef..fb7bff8d65 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs @@ -8,14 +8,20 @@ namespace BizHawk.Client.Common { public void RemoveFrom(int frame) { - if (frame + 1 < this.Count) + if (frame > 0 && frame < this.Count) { - this.RemoveRange(frame + 1, this.Count - frame - 1); + this.RemoveRange(frame - 1, this.Count - frame); } } public bool? Lagged(int index) { + // Hacky but effective, we haven't record the lag information for the current frame yet + if (index == Global.Emulator.Frame - 1) + { + return Global.Emulator.IsLagFrame; + } + if (index < this.Count) { return this[index]; diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs index 8b2a22b831..cefecf5caf 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs @@ -14,8 +14,11 @@ namespace BizHawk.Client.Common { base.RecordFrame(frame, source); - LagLog.RemoveFrom(frame); - LagLog.Add(Global.Emulator.IsLagFrame); + if (frame > 0) + { + LagLog.RemoveFrom(frame); + LagLog.Add(Global.Emulator.IsLagFrame); + } StateManager.Capture(); } diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs index 6afa2d0bd4..176998acbf 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs @@ -290,10 +290,11 @@ namespace BizHawk.Client.Common // TODO: states and lag capture if (Global.Emulator.Frame == frame) // Take this opportunity to capture lag and state info if we do not have it { - if (frame == LagLog.Count) // I intentionally did not do >=, if it were >= we missed some entries somewhere, oops, maybe this shoudl be a dictionary with frame values? - { - LagLog.Add(Global.Emulator.IsLagFrame); - } + // TODO + //if (frame == LagLog.Count) // I intentionally did not do >=, if it were >= we missed some entries somewhere, oops, maybe this shoudl be a dictionary with frame values? + //{ + // LagLog.Add(Global.Emulator.IsLagFrame); + //} if (!StateManager.HasState(frame)) {