Run failsave return in a task

This commit is contained in:
Eddoursul 2022-08-18 14:35:02 +02:00
parent 804504e7a2
commit ddb85480d2
2 changed files with 4 additions and 2 deletions

View File

@ -79,10 +79,12 @@ auto EventListener::ProcessEvent(
SKSE::GetTaskInterface()->AddTask([furn]() { SKSE::GetTaskInterface()->AddTask([furn]() {
FetchSupplies(furn); FetchSupplies(furn);
}); });
std::thread([furn]() { std::thread([]() {
std::this_thread::sleep_for(std::chrono::milliseconds(500)); std::this_thread::sleep_for(std::chrono::milliseconds(500));
if (!RE::UI::GetSingleton()->IsMenuOpen(RE::CraftingMenu::MENU_NAME)) { if (!RE::UI::GetSingleton()->IsMenuOpen(RE::CraftingMenu::MENU_NAME)) {
ReturnSupplies(); SKSE::GetTaskInterface()->AddTask([]() {
ReturnSupplies();
});
} }
}).detach(); }).detach();
} else { } else {