X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fserver%2Fmods.cpp;h=83fa12da9f5ba12b36412c0931d4b0513c48c6c6;hb=b7b5aad02758ae897fc0239f50f93e04d085ceed;hp=c8d8a28e290b76192f97ace87a27d9aaa0a1cc82;hpb=de73f989eb1397b1103236031fd91309b294583c;p=dragonfireclient.git diff --git a/src/server/mods.cpp b/src/server/mods.cpp index c8d8a28e2..83fa12da9 100644 --- a/src/server/mods.cpp +++ b/src/server/mods.cpp @@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "scripting_server.h" #include "content/subgames.h" #include "porting.h" +#include "util/metricsbackend.h" /** * Manage server mods @@ -97,11 +98,12 @@ void ServerModManager::getModNames(std::vector &modlist) const void ServerModManager::getModsMediaPaths(std::vector &paths) const { - for (const ModSpec &spec : m_sorted_mods) { - paths.push_back(spec.path + DIR_DELIM + "textures"); - paths.push_back(spec.path + DIR_DELIM + "sounds"); - paths.push_back(spec.path + DIR_DELIM + "media"); - paths.push_back(spec.path + DIR_DELIM + "models"); - paths.push_back(spec.path + DIR_DELIM + "locale"); + for (auto it = m_sorted_mods.crbegin(); it != m_sorted_mods.crend(); it++) { + const ModSpec &spec = *it; + fs::GetRecursiveDirs(paths, spec.path + DIR_DELIM + "textures"); + fs::GetRecursiveDirs(paths, spec.path + DIR_DELIM + "sounds"); + fs::GetRecursiveDirs(paths, spec.path + DIR_DELIM + "media"); + fs::GetRecursiveDirs(paths, spec.path + DIR_DELIM + "models"); + fs::GetRecursiveDirs(paths, spec.path + DIR_DELIM + "locale"); } }