Skip to content

Commit

Permalink
Fixed issue with auto-saving games
Browse files Browse the repository at this point in the history
  • Loading branch information
skotz committed Dec 18, 2016
1 parent 00e668e commit 02ad85f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Chase.GUI/GameForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,15 @@ private void Game_OnFoundBestMove(SearchResult result)
}
else
{
game.SaveGameToFile("game." + DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt");
try
{
game.SaveGameToFile("game." + DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt");
}
catch (UnauthorizedAccessException)
{
// This doesn't work when running from the installed Programs folder, so eat the exception.
}

MessageBox.Show(winner.ToString() + " wins!", "Chase", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
Expand Down

0 comments on commit 02ad85f

Please sign in to comment.