mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Allow overwriting media files of dependencies (#10752)
This commit is contained in:
parent
29681085b9
commit
4abe4b87b5
8 changed files with 21 additions and 4 deletions
|
@ -98,7 +98,8 @@ 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) {
|
||||
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");
|
||||
|
|
|
@ -42,5 +42,13 @@ public:
|
|||
void loadMods(ServerScripting *script);
|
||||
const ModSpec *getModSpec(const std::string &modname) const;
|
||||
void getModNames(std::vector<std::string> &modlist) const;
|
||||
/**
|
||||
* Recursively gets all paths of mod folders that can contain media files.
|
||||
*
|
||||
* Result is ordered in descending priority, ie. files from an earlier path
|
||||
* should not be replaced by files from a latter one.
|
||||
*
|
||||
* @param paths result vector
|
||||
*/
|
||||
void getModsMediaPaths(std::vector<std::string> &paths) const;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue