From 626a65cb380978ece5ec264ef9bd5361f282dbf0 Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:13:20 -0300 Subject: [PATCH] ok we do need addSearchPath in updateModResources --- loader/src/loader/LoaderImpl.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/loader/src/loader/LoaderImpl.cpp b/loader/src/loader/LoaderImpl.cpp index 994cfe89..2b7e89ab 100644 --- a/loader/src/loader/LoaderImpl.cpp +++ b/loader/src/loader/LoaderImpl.cpp @@ -128,6 +128,10 @@ void Loader::Impl::updateResources(bool forceReload) { this->updateModResources(mod); ModImpl::getImpl(mod)->m_resourcesLoaded = true; } + // deduplicate mod resource paths, since they added in both updateModResources and Mod::Impl::setup + // we have to call it in both places since setup is only called once ever, but updateResources is called + // on every texture reload + CCFileUtils::get()->updatePaths(); log::popNest(); } @@ -215,7 +219,11 @@ Mod* Loader::Impl::getLoadedMod(std::string const& id) const { } void Loader::Impl::updateModResources(Mod* mod) { - // search path is added in Mod::Impl::setup + if (!mod->isInternal()) { + // geode.loader resource is stored somewhere else, which is already added anyway + auto searchPathRoot = dirs::getModRuntimeDir() / mod->getID() / "resources"; + CCFileUtils::get()->addSearchPath(searchPathRoot.string().c_str()); + } // only thing needs previous setup is spritesheets if (mod->getMetadata().getSpritesheets().empty())