summaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2019-01-06 09:23:35 +0000
committerLoïc Blot <nerzhul@users.noreply.github.com>2019-01-06 10:23:35 +0100
commit70bf3439ab9f3cb826d76111552dcc38678fcf3d (patch)
tree1c56f6667e84b3f979c0b1bfcbc18db7cfbf2cc7 /src/content
parent3a9fe2bd5b0c112150eb20e375729aea7a4776f4 (diff)
downloadminetest-70bf3439ab9f3cb826d76111552dcc38678fcf3d.tar.gz
minetest-70bf3439ab9f3cb826d76111552dcc38678fcf3d.tar.bz2
minetest-70bf3439ab9f3cb826d76111552dcc38678fcf3d.zip
Deprecate modpack.txt and use modpack.conf instead (#7892)
* Deprecate modpack.txt and use modpack.conf instead
Diffstat (limited to 'src/content')
-rw-r--r--src/content/content.cpp8
-rw-r--r--src/content/mods.cpp12
2 files changed, 15 insertions, 5 deletions
diff --git a/src/content/content.cpp b/src/content/content.cpp
index d7a2c9652..66ef83d42 100644
--- a/src/content/content.cpp
+++ b/src/content/content.cpp
@@ -41,6 +41,12 @@ ContentType getContentType(const ContentSpec &spec)
return ECT_MODPACK;
}
+ std::ifstream modpack2_is((spec.path + DIR_DELIM + "modpack.conf").c_str());
+ if (modpack2_is.good()) {
+ modpack2_is.close();
+ return ECT_MODPACK;
+ }
+
std::ifstream init_is((spec.path + DIR_DELIM + "init.lua").c_str());
if (init_is.good()) {
init_is.close();
@@ -73,7 +79,7 @@ void parseContentInfo(ContentSpec &spec)
break;
case ECT_MODPACK:
spec.type = "modpack";
- conf_path = spec.path + DIR_DELIM + "mod.conf";
+ conf_path = spec.path + DIR_DELIM + "modpack.conf";
break;
case ECT_GAME:
spec.type = "game";
diff --git a/src/content/mods.cpp b/src/content/mods.cpp
index a3e706760..3cb168e19 100644
--- a/src/content/mods.cpp
+++ b/src/content/mods.cpp
@@ -66,12 +66,16 @@ void parseModContents(ModSpec &spec)
// Handle modpacks (defined by containing modpack.txt)
std::ifstream modpack_is((spec.path + DIR_DELIM + "modpack.txt").c_str());
- if (modpack_is.good()) { // a modpack, recursively get the mods in it
- modpack_is.close(); // We don't actually need the file
+ std::ifstream modpack2_is((spec.path + DIR_DELIM + "modpack.conf").c_str());
+ if (modpack_is.good() || modpack2_is.good()) {
+ if (modpack_is.good())
+ modpack_is.close();
+
+ if (modpack2_is.good())
+ modpack2_is.close();
+
spec.is_modpack = true;
spec.modpack_content = getModsInPath(spec.path, true);
- // modpacks have no dependencies; they are defined and
- // tracked separately for each mod in the modpack
} else {
// Attempt to load dependencies from mod.conf