From ac6cf7a18d00e9a0612377f50239b284ad78d820 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 16 Sep 2012 14:12:42 +0000 Subject: [PATCH] Movies - fix a logical flaw in a case in movie finished mode. While in movie finished mode, a timeline check should still be done (if in read-only mode) before loading a state from a different timeline (even if that savestate is a post-movie savestate). This matches behavior in FCEUX 2.1.6 (all versions of FCEUX and BizHawk until now have this bug) --- BizHawk.MultiClient/movie/Movie.cs | 33 +++++++++++++++++------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/BizHawk.MultiClient/movie/Movie.cs b/BizHawk.MultiClient/movie/Movie.cs index aff535f42c..49cf02ee90 100644 --- a/BizHawk.MultiClient/movie/Movie.cs +++ b/BizHawk.MultiClient/movie/Movie.cs @@ -720,20 +720,7 @@ namespace BizHawk.MultiClient return true; } - if (stateFrame > l.Length) //stateFrame is greater than state input log, so movie finished mode - { - if (Mode == MOVIEMODE.PLAY || Mode == MOVIEMODE.FINISHED) - { - Mode = MOVIEMODE.FINISHED; - return true; - } - else - return false; //For now throw an error if recording, ideally what should happen is that the state gets loaded, and the movie set to movie finished, the movie at its current state is preserved and the state is loaded just fine. This should probably also only happen if checktimelines passes - } - else if (Mode == MOVIEMODE.FINISHED) - { - Mode = MOVIEMODE.PLAY; - } + if (stateFrame == 0) { @@ -760,6 +747,24 @@ namespace BizHawk.MultiClient return false; } } + + + + if (stateFrame > l.Length) //stateFrame is greater than state input log, so movie finished mode + { + if (Mode == MOVIEMODE.PLAY || Mode == MOVIEMODE.FINISHED) + { + Mode = MOVIEMODE.FINISHED; + return true; + } + else + return false; //For now throw an error if recording, ideally what should happen is that the state gets loaded, and the movie set to movie finished, the movie at its current state is preserved and the state is loaded just fine. This should probably also only happen if checktimelines passes + } + else if (Mode == MOVIEMODE.FINISHED) + { + Mode = MOVIEMODE.PLAY; + } + reader.Close(); return true; }