diff --git a/entry.cpp b/entry.cpp index cf19cb706..0ce0b5713 100644 --- a/entry.cpp +++ b/entry.cpp @@ -16,5 +16,5 @@ namespace geode { namespace { // to make sure the instance is set into the sharedMod<> in load time - static auto mod = geode::getMod(); + static auto mod = geode::getMod(); } diff --git a/loader/src/load.cpp b/loader/src/load.cpp index ba8499123..b02001e2e 100644 --- a/loader/src/load.cpp +++ b/loader/src/load.cpp @@ -60,7 +60,7 @@ using namespace geode::prelude; int geodeEntry(void* platformData) { log::Logger::setup(); - log::info("Entry"); + log::info("Running {} {}", Mod::get()->getName(), Mod::get()->getVersion()); auto begin = std::chrono::high_resolution_clock::now(); diff --git a/loader/src/loader/ModImpl.cpp b/loader/src/loader/ModImpl.cpp index 67058a5bf..a24724b04 100644 --- a/loader/src/loader/ModImpl.cpp +++ b/loader/src/loader/ModImpl.cpp @@ -627,6 +627,11 @@ Mod* Loader::Impl::getInternalMod() { auto& mod = Mod::sharedMod<>; if (mod) return mod; + if (m_mods.contains("geode.loader")) { + log::warn("Something went wrong and Mod::sharedMod<> got unset after the internal mod was created! Setting sharedMod back..."); + mod = m_mods["geode.loader"]; + return mod; + } auto infoRes = getModImplInfo(); if (!infoRes) { LoaderImpl::get()->platformMessageBox( @@ -643,7 +648,6 @@ Mod* Loader::Impl::getInternalMod() { } mod->m_impl->m_enabled = true; m_mods.insert({ mod->getID(), mod }); - log::debug("Created internal mod {}", mod->getName()); return mod; }