From 9e8c152ddeb48df8e1aaabb994370cc51e82f964 Mon Sep 17 00:00:00 2001 From: feos Date: Mon, 29 Aug 2016 21:18:55 +0300 Subject: [PATCH] tastudio history: fix bug where undoing the movie extension (caused by drawing beyond the movie length) would swallow all the movie --- BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs index d59a8b82e5..1b00ba1d3c 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs @@ -335,6 +335,8 @@ namespace BizHawk.Client.Common var minuend = Math.Min(lastFrame + 1, movie.InputLogLength); if (firstFrame > minuend) undoLength = minuend; + else if (firstFrame == minuend) + undoLength = Math.Max(lastFrame + 1, movie.InputLogLength) - firstFrame; else undoLength = minuend - firstFrame;