BinarySavestates - add a HasLump() method, and use it to check for clientsettings in tasproj since it may or may not have it

This commit is contained in:
adelikat 2014-10-15 15:55:41 +00:00
parent 3be3264d60
commit 5436a7d24e
2 changed files with 8 additions and 1 deletions

View File

@ -167,6 +167,13 @@ namespace BizHawk.Client.Common
}
}
public bool HasLump(BinaryStateLump lump)
{
string name = BinaryStateFileNames.GetReadName(lump);
ZipEntry e;
return _entriesbyname.TryGetValue(name, out e);
}
/// <summary>
/// Gets a lump
/// </summary>

View File

@ -183,7 +183,7 @@ namespace BizHawk.Client.Common
}
});
if (GetClientSettingsOnLoad != null)
if (GetClientSettingsOnLoad != null && bl.HasLump(BinaryStateLump.ClientSettings))
{
string clientSettings = string.Empty;
bl.GetLump(BinaryStateLump.ClientSettings, true, delegate(TextReader tr)