From a365284383e2488909e99966db5aeada5de7add9 Mon Sep 17 00:00:00 2001 From: feos Date: Wed, 22 Aug 2018 20:04:57 +0300 Subject: [PATCH] tastudio states decay: fix logic for last edited frame --- .../movie/tasproj/StateManagerDecay.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs b/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs index 4219f31eb0..4d551f86e6 100644 --- a/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs +++ b/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs @@ -79,7 +79,11 @@ namespace BizHawk.Client.Common { continue; } - else if ((currentFrame % _step > 0) && (currentFrame + 1 != _tsm.LastEditedFrame)) + else if (currentFrame + 1 == _tsm.LastEditedFrame) + { + continue; + } + else if (currentFrame % _step > 0) { // ignore the pattern if the state doesn't belong already, drop it blindly and skip everything if (_tsm.RemoveState(currentFrame)) @@ -190,8 +194,8 @@ namespace BizHawk.Client.Common } else { - // we're very sorry about failing to find states to remove, but we can't go beyond capacity, so remove at least something - // this shouldn't happen, but if we don't do it here, nothing good will happen either + // we're very sorry about failing to find states to remove, but we can't go beyond capacity, so remove at least something + // this shouldn't happen, but if we don't do it here, nothing good will happen either if (_tsm.RemoveState(_tsm.GetStateFrameByIndex(1))) { // decrementing this if no state was removed is BAD