1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-07 00:58:39 +02:00

Change ClientCommandManager to become non-static

This commit is contained in:
Dydzio
2023-01-15 01:09:58 +01:00
parent 91a52ebb8e
commit 06376ca4ef
4 changed files with 23 additions and 12 deletions

View File

@ -1154,7 +1154,13 @@ void CInGameConsole::endEnteringText(bool processEnteredText)
if(txt.at(0) == '/')
{
//some commands like gosolo don't work when executed from GUI thread
boost::thread clientCommandThread(ClientCommandManager::processCommand, txt.substr(1), true);
auto threadFunction = [=]()
{
ClientCommandManager commandController;
commandController.processCommand(txt.substr(1), true);
};
boost::thread clientCommandThread(threadFunction);
clientCommandThread.detach();
}
else