Fix bug in MovieHeader that throws an exception in the Play Movie dialog if a movie with Board Properties is loaded (this is just a work around to a problem caused by a bad design!)

This commit is contained in:
adelikat 2013-11-15 16:52:29 +00:00
parent 06d61598d3
commit ad848c5e96
1 changed files with 10 additions and 1 deletions

View File

@ -78,6 +78,15 @@ namespace BizHawk.Client.Common
HeaderParams.Add(key, value); HeaderParams.Add(key, value);
} }
public void AddBoardProperty(string key, string value)
{
string temp;
if (!BoardProperties.TryGetValue(key, out temp))
{
BoardProperties.Add(key, value);
}
}
public void UpdateRerecordCount(int count) public void UpdateRerecordCount(int count)
{ {
HeaderParams[RERECORDS] = count.ToString(); HeaderParams[RERECORDS] = count.ToString();
@ -232,7 +241,7 @@ namespace BizHawk.Client.Common
{ {
line = ParseHeader(line, BOARDPROPERTIES); line = ParseHeader(line, BOARDPROPERTIES);
string[] vals = line.Split(' '); string[] vals = line.Split(' ');
BoardProperties.Add(vals[0], vals[1]); AddBoardProperty(vals[0], vals[1]);
} }
else if (line.StartsWith("subtitle") || line.StartsWith("sub")) else if (line.StartsWith("subtitle") || line.StartsWith("sub"))
{ {