Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
fixed crash on saving screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
MgAl2O4 committed Feb 16, 2021
1 parent 56f2963 commit 6e9712a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
19 changes: 13 additions & 6 deletions SINoCOLO/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,25 @@ private void GameLogic_OnMouseClickRequested(int posX, int posY)

private void GameLogic_OnSaveScreenshot()
{
if (cachedSourceScreen != null)
try
{
for (int idx = 1; idx < 1000000; idx++)
if (cachedSourceScreen != null)
{
string testPath = "screenshot-" + idx + ".jpg";
if (!System.IO.File.Exists(testPath))
for (int idx = 1; idx < 1000000; idx++)
{
cachedSourceScreen.Save(testPath);
break;
string testPath = "screenshot-" + idx + ".jpg";
if (!System.IO.File.Exists(testPath))
{
cachedSourceScreen.Save(testPath);
break;
}
}
}
}
catch (Exception ex)
{
Console.WriteLine("Exception on saving:" + ex);
}
}

private void GameLogic_OnEventCounterUpdated()
Expand Down
4 changes: 2 additions & 2 deletions SINoCOLO/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("23.0.0.0")]
[assembly: AssemblyFileVersion("23.0.0.0")]
[assembly: AssemblyVersion("24.0.0.0")]
[assembly: AssemblyFileVersion("24.0.0.0")]

0 comments on commit 6e9712a

Please sign in to comment.