TasStateManager - Invalidate() - take savestate anchored movies into account

This commit is contained in:
adelikat 2014-10-25 19:33:28 +00:00
parent b301546237
commit 170bc4aab0
1 changed files with 6 additions and 1 deletions

View File

@ -168,8 +168,13 @@ namespace BizHawk.Client.Common
/// </summary>
public void Invalidate(int frame)
{
if (States.Count > 0 && frame > 0) // Never invalidate frame 0, TODO: Only if movie is a power-on movie should we keep frame 0, check this
if (Any())
{
if (!_movie.StartsFromSavestate && frame == 0) // Never invalidate frame 0 on a non-savestate-anchored movie
{
frame = 1;
}
var statesToRemove = States
.Where(x => x.Key >= frame)
.ToList();