From e95d454b45acf51e342c66880a07ecd4ce7e893f Mon Sep 17 00:00:00 2001 From: altalk23 <45172705+altalk23@users.noreply.github.com> Date: Sun, 4 Feb 2024 14:42:22 +0300 Subject: [PATCH] fix currently loading crashlog --- loader/src/internal/crashlog.cpp | 2 +- loader/src/loader/ModImpl.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/loader/src/internal/crashlog.cpp b/loader/src/internal/crashlog.cpp index ced31b1f..8e9a0106 100644 --- a/loader/src/internal/crashlog.cpp +++ b/loader/src/internal/crashlog.cpp @@ -41,10 +41,10 @@ void crashlog::printMods(std::stringstream& stream) { using namespace std::string_view_literals; for (auto& mod : mods) { stream << fmt::format("{} | [{}] {}\n", + ModImpl::getImpl(mod)->isCurrentlyLoading() ? "o"sv : mod->isEnabled() ? "x"sv : ModImpl::getImpl(mod)->hasProblems() ? "!"sv : // thank you for this bug report mod->shouldLoad() ? "~"sv : - ModImpl::getImpl(mod)->isCurrentlyLoading() ? "o"sv : " "sv, mod->getVersion().toString(), mod->getID() ); diff --git a/loader/src/loader/ModImpl.cpp b/loader/src/loader/ModImpl.cpp index d1cd46e8..6f780352 100644 --- a/loader/src/loader/ModImpl.cpp +++ b/loader/src/loader/ModImpl.cpp @@ -385,7 +385,6 @@ Result<> Mod::Impl::loadBinary() { log::error("Failed to load binary for mod {}: {}", m_metadata.getID(), res.unwrapErr()); return res; } - m_isCurrentlyLoading = false; LoaderImpl::get()->releaseNextMod(); @@ -393,6 +392,8 @@ Result<> Mod::Impl::loadBinary() { ModStateEvent(m_self, ModEventType::Loaded).post(); ModStateEvent(m_self, ModEventType::Enabled).post(); + m_isCurrentlyLoading = false; + return Ok(); }