revert "Use Ranges" on TasMovie since it causes exceptions when attempting to create the first branch of a tasproj

This commit is contained in:
adelikat 2020-01-17 09:00:56 -06:00
parent c27bea3272
commit 45003ea584
1 changed files with 10 additions and 3 deletions

View File

@ -5,7 +5,6 @@ using System.Globalization;
using System.IO;
using System.Linq;
using BizHawk.Common;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Common.IEmulatorExtensions;
@ -347,7 +346,7 @@ namespace BizHawk.Client.Common
var stateFrameValue = stateFrame ?? 0;
if (stateFrameValue.StrictlyBoundedBy(0.RangeTo(Log.Count)))
if (stateFrameValue > 0 && stateFrameValue < Log.Count)
{
if (!Global.Config.VBAStyleMovieLoadState)
{
@ -380,7 +379,15 @@ namespace BizHawk.Client.Common
#region Branches
public TasBranch GetBranch(int index) => 0.RangeToExclusive(Branches.Count).Contains(index) ? Branches[index] : null;
public TasBranch GetBranch(int index)
{
if (index >= Branches.Count || index < 0)
{
return null;
}
return Branches[index];
}
public TasBranch GetBranch(Guid id)
{