tastudio: be able to load broken greenzone file.

This commit is contained in:
feos 2016-04-23 20:53:50 +03:00
parent 838e986847
commit f35938acdb
1 changed files with 14 additions and 13 deletions

View File

@ -578,8 +578,8 @@ namespace BizHawk.Client.Common
public void Load(BinaryReader br) public void Load(BinaryReader br)
{ {
States.Clear(); States.Clear();
//if (br.BaseStream.Length > 0) try
//{ BaseStream.Length does not return the expected value. {
int nstates = br.ReadInt32(); int nstates = br.ReadInt32();
for (int i = 0; i < nstates; i++) for (int i = 0; i < nstates; i++)
{ {
@ -592,7 +592,8 @@ namespace BizHawk.Client.Common
//States.Add(frame, data); //States.Add(frame, data);
//Used += len; //Used += len;
} }
//} }
catch (EndOfStreamException) { }
} }
public void SaveBranchStates(BinaryWriter bw) public void SaveBranchStates(BinaryWriter bw)