aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2017-06-23 01:51:57 +0100
committerparamat <mat.gregory@virginmedia.com>2018-01-16 08:45:17 +0000
commit4c0d4e4105d2f2e63b9a43bb83fecf92288f63b3 (patch)
tree36a586497c474ec35fd26fc58d48ba8397916b6f /src/server.cpp
parent70a90bc83a0b244a494627cfbc0305946bb1e593 (diff)
downloadhax-minetest-server-4c0d4e4105d2f2e63b9a43bb83fecf92288f63b3.tar.gz
hax-minetest-server-4c0d4e4105d2f2e63b9a43bb83fecf92288f63b3.zip
Load a texturepack from the 'textures' subfolder of a game
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp10
1 files changed, 7 insertions, 3 deletions
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<std::string> 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<fs::DirListNode> dirlist = fs::GetDirListing(mediapath);