Fixed TAStudio crashing on truncating movie in greenzone.

This commit is contained in:
kylelyk 2014-08-21 18:45:14 +00:00
parent 978ff6eb9d
commit 26c65d727d
2 changed files with 6 additions and 2 deletions

View File

@ -90,7 +90,7 @@ namespace BizHawk.Client.Common
public virtual void Truncate(int frame)
{
// This is a bad way to do multitrack logic, pass the info in instead of going to the global
// and it is weird for Truncte to possibly not truncate
// and it is weird for Truncate to possibly not truncate
if (!Global.MovieSession.MultiTrack.IsActive)
{
if (frame < _log.Count)

View File

@ -25,13 +25,17 @@ namespace BizHawk.Client.Common
StateManager.Capture();
}
/// <summary>
/// Truncate all frames including starting frame to end of movie.
/// </summary>
/// <param name="frame">First frame to be truncated.</param>
public override void Truncate(int frame)
{
base.Truncate(frame);
if (frame < LagLog.Count)
{
LagLog.RemoveRange(frame + 2, LagLog.Count - frame - 1);
LagLog.RemoveRange(frame, LagLog.Count - frame - 1);
}
StateManager.Invalidate(frame + 1);