mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 01:45:35 -05:00
Fix search paths when reloaded
This commit is contained in:
parent
87749d46c2
commit
65b4364ab5
1 changed files with 6 additions and 6 deletions
|
@ -218,6 +218,12 @@ Mod* Loader::Impl::getLoadedMod(std::string const& id) const {
|
|||
void Loader::Impl::updateModResources(Mod* mod) {
|
||||
if (mod->getMetadata().getSpritesheets().empty())
|
||||
return;
|
||||
|
||||
if (mod != Mod::get()) {
|
||||
// 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());
|
||||
}
|
||||
|
||||
auto searchPath = mod->getResourcesDir();
|
||||
|
||||
|
@ -347,12 +353,6 @@ void Loader::Impl::populateModList(std::vector<ModMetadata>& modQueue) {
|
|||
|
||||
m_mods.insert({metadata.getID(), mod});
|
||||
|
||||
queueInMainThread([this, mod]() {
|
||||
auto searchPath = dirs::getModRuntimeDir() / mod->getID() / "resources";
|
||||
CCFileUtils::get()->addSearchPath(searchPath.string().c_str());
|
||||
updateModResources(mod);
|
||||
});
|
||||
|
||||
log::popNest();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue