1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Deprecate modpack.txt and use modpack.conf instead (#7892)

* Deprecate modpack.txt and use modpack.conf instead
This commit is contained in:
rubenwardy 2019-01-06 09:23:35 +00:00 committed by Loïc Blot
parent 3a9fe2bd5b
commit 70bf3439ab
6 changed files with 75 additions and 23 deletions

View file

@ -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";

View file

@ -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