From 946fbf254d11ab2e500b6db4897d7412f06ce260 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 20 Mar 2022 21:01:06 +0100 Subject: [PATCH] Fix running game check --- TBMM/MainUtils.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/TBMM/MainUtils.cs b/TBMM/MainUtils.cs index db82cad..66cfc85 100644 --- a/TBMM/MainUtils.cs +++ b/TBMM/MainUtils.cs @@ -142,17 +142,14 @@ namespace TBMM return false; default: Debug.WriteLine($"Process seems to be null: {_gameProcess}"); - if (_gameProcess.Process?.HasExited ?? true) - { - _gameProcess = (Process.GetProcessesByName(GetExe(withExtension: false)).FirstOrDefault(), false); - Debug.WriteLine($"Game process exited already, got new process object: {_gameProcess}"); - } + _gameProcess = (Process.GetProcessesByName(GetExe(withExtension: false)).FirstOrDefault(), false); + Debug.WriteLine($"Game process exited already, got new process object: {_gameProcess}"); if (_gameProcess.Process == null) return false; if (_gameProcess.Process.HasExited) { Debug.WriteLine($"Game has exited already: {_gameProcess}"); - HandleGameExit(null, EventArgs.Empty); + _gameProcess = (null, false); return false; } else