diff options
author | Lars Müller <34514239+appgurueu@users.noreply.github.com> | 2022-07-29 10:19:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-29 10:19:36 +0200 |
commit | 99c8295e71eb86333ae21b1083b6f55fb9479565 (patch) | |
tree | aec177f62fac0b3efe0c6e745e2bb31219b20d95 /src/server | |
parent | 6611d7e1ee3b078b5c3414bf57833755d8b43620 (diff) | |
download | minetest-99c8295e71eb86333ae21b1083b6f55fb9479565.tar.gz minetest-99c8295e71eb86333ae21b1083b6f55fb9479565.tar.bz2 minetest-99c8295e71eb86333ae21b1083b6f55fb9479565.zip |
Fix media overriding regression (#12602)
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/mods.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/mods.cpp b/src/server/mods.cpp index ac4181e4d..0e9bf4911 100644 --- a/src/server/mods.cpp +++ b/src/server/mods.cpp @@ -94,7 +94,11 @@ void ServerModManager::getModNames(std::vector<std::string> &modlist) const void ServerModManager::getModsMediaPaths(std::vector<std::string> &paths) const { - for (const auto &spec : configuration.getMods()) { + // Iterate mods in reverse load order: Media loading expects higher priority media files first + // and mods loading later should be able to override media of already loaded mods + const auto mods = configuration.getMods(); + for (auto it = mods.crbegin(); it != 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"); |