1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-07 23:33:15 +02:00

NKAI: fix headless and compilation

This commit is contained in:
Andrii Danylchenko
2024-03-24 13:16:46 +02:00
parent 419d6a648b
commit 3820f6f78b
6 changed files with 72 additions and 10 deletions

View File

@@ -56,6 +56,7 @@ namespace po = boost::program_options;
namespace po_style = boost::program_options::command_line_style;
static std::atomic<bool> quitRequestedDuringOpeningPlayback = false;
static std::atomic<bool> headlessQuit = false;
#ifndef VCMI_IOS
void processCommand(const std::string &message);
@@ -371,8 +372,10 @@ int main(int argc, char * argv[])
}
else
{
while(true)
while(!headlessQuit)
boost::this_thread::sleep_for(boost::chrono::milliseconds(200));
quitApplication();
}
return 0;
@@ -481,7 +484,15 @@ void handleQuit(bool ask)
// proper solution would be to abort init thread (or wait for it to finish)
if(!ask)
{
quitApplication();
if(settings["session"]["headless"].Bool())
{
headlessQuit = true;
}
else
{
quitApplication();
}
return;
}