From a0e5e0e593d25171312d1fc9dcb46e96d7b93542 Mon Sep 17 00:00:00 2001 From: feos Date: Thu, 10 May 2018 20:32:26 +0300 Subject: [PATCH] tastudio: actually don't drop state above last edited frame --- BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs | 4 ++-- BizHawk.Client.Common/movie/tasproj/TasStateManager.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs b/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs index 65156ea512..4219f31eb0 100644 --- a/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs +++ b/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs @@ -79,7 +79,7 @@ namespace BizHawk.Client.Common { continue; } - else if (currentFrame % _step > 0) + else if ((currentFrame % _step > 0) && (currentFrame + 1 != _tsm.LastEditedFrame)) { // ignore the pattern if the state doesn't belong already, drop it blindly and skip everything if (_tsm.RemoveState(currentFrame)) @@ -120,7 +120,7 @@ namespace BizHawk.Client.Common { continue; } - else if (currentFrame % _step > 0) + else if ((currentFrame % _step > 0) && (currentFrame + 1 != _tsm.LastEditedFrame)) { // ignore the pattern if the state doesn't belong already, drop it blindly and skip everything if (_tsm.RemoveState(currentFrame)) diff --git a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs index 0c02cb910b..3b2920814c 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs @@ -505,6 +505,7 @@ namespace BizHawk.Client.Common } public int StateCount => _states.Count; + public int LastEditedFrame => _movie.LastEditedFrame; public bool Any() {