Play Movie - don't crash on headers with duplicate keys, don't throw an exception when movie files to parse
This commit is contained in:
parent
bca069325b
commit
a6944c47d8
|
@ -174,7 +174,7 @@ namespace BizHawk.Client.Common
|
|||
BoardProperties.Add(boardSplit[0], boardSplit[1]);
|
||||
}
|
||||
}
|
||||
else if (HeaderKeys.Contains(splitLine[0]))
|
||||
else if (HeaderKeys.Contains(splitLine[0]) && !this.ContainsKey(splitLine[0]))
|
||||
{
|
||||
Add(splitLine[0], splitLine[1]);
|
||||
}
|
||||
|
|
|
@ -136,9 +136,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
private void PreLoadMovieFile(HawkFile hf, bool force)
|
||||
{
|
||||
var movie = new Movie(hf.CanonicalFullPath);
|
||||
movie.PreLoadText(hf);
|
||||
|
||||
try
|
||||
{
|
||||
movie.PreLoadText(hf);
|
||||
|
||||
// Don't do this from browse
|
||||
if (movie.Header[HeaderKeys.GAMENAME] == Global.Game.Name ||
|
||||
Global.Config.PlayMovie_MatchGameName == false || force)
|
||||
|
@ -148,6 +150,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// TODO: inform the user that a movie failed to parse in some way
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue