1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-26 18:21:04 +00:00

working flags

This commit is contained in:
Xeno333 2025-06-16 19:09:07 -05:00
parent 060696be24
commit 8765654e46
5 changed files with 63 additions and 7 deletions

View file

@ -148,13 +148,21 @@ bool parseModContents(ModSpec &spec)
}
} else {
if (info.exists("mg_flags")) {
std::string dep = info.get("mg_flags");
dep.erase(std::remove_if(dep.begin(), dep.end(),
static_cast<int (*)(int)>(&std::isspace)), dep.end());
for (const auto &flag : str_split(dep, ',')) {
std::string mg_flags = info.get("mg_flags");
mg_flags.erase(std::remove_if(mg_flags.begin(), mg_flags.end(),
static_cast<int (*)(int)>(&std::isspace)), mg_flags.end());
for (const auto &flag : str_split(mg_flags, ',')) {
spec.mg_flags.insert(flag);
}
}
if (info.exists("lmg_flags")) {
std::string lmg_flags = info.get("lmg_flags");
lmg_flags.erase(std::remove_if(lmg_flags.begin(), lmg_flags.end(),
static_cast<int (*)(int)>(&std::isspace)), lmg_flags.end());
for (const auto &flag : str_split(lmg_flags, ',')) {
spec.lmg_flags.insert(flag);
}
}
}
if (info.exists("description"))