]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/server/mods.cpp
Fix revoke debug privs not reliably turn off stuff (#11409)
[dragonfireclient.git] / src / server / mods.cpp
index c8d8a28e290b76192f97ace87a27d9aaa0a1cc82..83fa12da9f5ba12b36412c0931d4b0513c48c6c6 100644 (file)
@@ -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<std::string> &modlist) const
 
 void ServerModManager::getModsMediaPaths(std::vector<std::string> &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");
        }
 }