fix last commit

This commit is contained in:
adelikat 2014-10-02 23:19:37 +00:00
parent 535ba7dc4a
commit d0970c5ba4
1 changed files with 13 additions and 7 deletions

View File

@ -138,15 +138,21 @@ namespace BizHawk.Client.Common
/// </summary>
public void Clear()
{
var power = States.FirstOrDefault(s => s.Key == 0);
States.Clear();
if (power.Value.Length > 0)
if (States.Any())
{
States.Add(0, power.Value);
}
var power = States.FirstOrDefault(s => s.Key == 0);
States.Clear();
Used = power.Value.Length;
if (power.Value.Length > 0)
{
States.Add(0, power.Value);
Used = power.Value.Length;
}
else
{
Used = 0;
}
}
}
public void Save(BinaryWriter bw)