From 4c0d4e4105d2f2e63b9a43bb83fecf92288f63b3 Mon Sep 17 00:00:00 2001 From: red-001 Date: Fri, 23 Jun 2017 01:51:57 +0100 Subject: Load a texturepack from the 'textures' subfolder of a game --- src/server.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server.cpp b/src/server.cpp index 26b3bb4b1..d011089c3 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -253,7 +253,10 @@ Server::Server( m_nodedef->updateAliases(m_itemdef); // Apply texture overrides from texturepack/override.txt - for (const auto &path : fs::GetRecursiveDirs(g_settings->get("texture_path"))) + std::vector paths; + fs::GetRecursiveDirs(paths, g_settings->get("texture_path")); + fs::GetRecursiveDirs(paths, m_gamespec.path + DIR_DELIM + "textures"); + for (const std::string &path : paths) m_nodedef->applyTextureOverrides(path + DIR_DELIM + "override.txt"); m_nodedef->setNodeRegistrationStatus(true); @@ -2259,8 +2262,9 @@ void Server::fillMediaCache() paths.push_back(mod.path + DIR_DELIM + "models"); paths.push_back(mod.path + DIR_DELIM + "locale"); } - fs::GetRecursiveDirs(paths, porting::path_user + DIR_DELIM + - "textures" + DIR_DELIM + "server"); + fs::GetRecursiveDirs(paths, m_gamespec.path + DIR_DELIM + "textures"); + fs::GetRecursiveDirs(paths, porting::path_user + DIR_DELIM + "textures" + DIR_DELIM + "server"); + // Collect media file information from paths into cache for (const std::string &mediapath : paths) { std::vector dirlist = fs::GetDirListing(mediapath); -- cgit v1.2.3