Skip to content

Commit

Permalink
Dont sleep in main thread
Browse files Browse the repository at this point in the history
  • Loading branch information
EddieEldridge committed Oct 2, 2024
1 parent 90d8085 commit c6aec26
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions M2TWEOP Code/M2TWEOP GUI/gameRunnerUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,10 @@ namespace gameRunnerUI
exit(0);
}
}
// Open Freecam if we are using the integration after waiting a bit for the game to start
std::this_thread::sleep_for(std::chrono::seconds(5));
if (helpers::isProcessRunning(dataG::data.gameData.exeName) == false)
{
return;
}
if (dataG::data.gameData.freecamIntegration == true && dataG::data.gameData.freecamStarted == false)
if ((dataG::data.gameData.freecamIntegration == true && dataG::data.gameData.freecamStarted == false && helpers::isProcessRunning(dataG::data.gameData.exeName) == true))
{
std::this_thread::sleep_for(std::chrono::seconds(5));
// Open Freecam if we are using the integration after waiting a bit for the game to start
string currentFolder;
string freecamFolder;
string exePath;
Expand Down

0 comments on commit c6aec26

Please sign in to comment.