fix: center-screen messages not appearing (fix: #446)

fix: crash when creating too much threads
refactor: fix typos in comments in headers
This commit is contained in:
jeefo 2023-05-12 22:12:22 +03:00
commit 7f4d4748fa
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
22 changed files with 105 additions and 99 deletions

View file

@ -1973,11 +1973,11 @@ void BotThreadWorker::startup (int workers) {
requestedThreadCount = 1;
}
}
requestedThreadCount = cr::clamp (requestedThreadCount, 1, hardwareConcurrency);
requestedThreadCount = cr::clamp (requestedThreadCount, 1, hardwareConcurrency - 1);
// notify user
game.print ("Starting up bot thread worker with %d threads.", requestedThreadCount);
// start up the worker
m_botWorker.startup (static_cast <int> (requestedThreadCount));
m_botWorker.startup (static_cast <size_t> (requestedThreadCount));
}