epic fix v2

This commit is contained in:
TotallyNotElite 2018-09-14 18:10:12 +02:00
parent d29e62fb59
commit 78d0b1cc35

View File

@ -93,6 +93,10 @@ static CatCommand save("save", "", [](const CCommand &args) {
void load_thread(const CCommand &args)
{
#if not ENABLE_VISUALS
std::this_thread::sleep_for(std::chrono_literals::operator""s(1));
settings::RVarLock.store(true);
#endif
std::this_thread::sleep_for(std::chrono_literals::operator""s(1));
settings::SettingsReader loader{ settings::Manager::instance() };
if (args.ArgC() == 1)
@ -122,7 +126,9 @@ void load_thread(const CCommand &args)
static CatCommand load("load", "", [](const CCommand &args) {
if (!settings::RVarLock.load())
{
#if ENABLE_VISUALS
settings::RVarLock.store(true);
#endif
std::thread saver(load_thread, args);
saver.detach();
}