Fix running game check
This commit is contained in:
parent
62963b6fd2
commit
946fbf254d
1 changed files with 3 additions and 6 deletions
|
@ -142,17 +142,14 @@ namespace TBMM
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
Debug.WriteLine($"Process seems to be null: {_gameProcess}");
|
Debug.WriteLine($"Process seems to be null: {_gameProcess}");
|
||||||
if (_gameProcess.Process?.HasExited ?? true)
|
|
||||||
{
|
|
||||||
_gameProcess = (Process.GetProcessesByName(GetExe(withExtension: false)).FirstOrDefault(), false);
|
_gameProcess = (Process.GetProcessesByName(GetExe(withExtension: false)).FirstOrDefault(), false);
|
||||||
Debug.WriteLine($"Game process exited already, got new process object: {_gameProcess}");
|
Debug.WriteLine($"Game process exited already, got new process object: {_gameProcess}");
|
||||||
}
|
|
||||||
|
|
||||||
if (_gameProcess.Process == null) return false;
|
if (_gameProcess.Process == null) return false;
|
||||||
if (_gameProcess.Process.HasExited)
|
if (_gameProcess.Process.HasExited)
|
||||||
{
|
{
|
||||||
Debug.WriteLine($"Game has exited already: {_gameProcess}");
|
Debug.WriteLine($"Game has exited already: {_gameProcess}");
|
||||||
HandleGameExit(null, EventArgs.Empty);
|
_gameProcess = (null, false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue