summaryrefslogtreecommitdiff
path: root/src/mods.cpp
diff options
context:
space:
mode:
authorceleron55 <celeron55@gmail.com>2013-01-23 10:10:25 -0800
committerceleron55 <celeron55@gmail.com>2013-01-23 10:10:25 -0800
commit0a27e81704241f856c387fa3f8c92d2773c14ef3 (patch)
treeb5ebc62c210f1ca10ea03711864899175e1724c6 /src/mods.cpp
parentc4af909ac844364124c092cd1d66a30ba1766303 (diff)
parentf0998612457ddc3027618e7e446ed968a14385e7 (diff)
downloadminetest-0a27e81704241f856c387fa3f8c92d2773c14ef3.tar.gz
minetest-0a27e81704241f856c387fa3f8c92d2773c14ef3.tar.bz2
minetest-0a27e81704241f856c387fa3f8c92d2773c14ef3.zip
Merge pull request #436 from doserj/mod_selection
Fix some crashes and improved behaviour for mod selection gui
Diffstat (limited to 'src/mods.cpp')
-rw-r--r--src/mods.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mods.cpp b/src/mods.cpp
index 9e3c7d5d7..f6e3d58d7 100644
--- a/src/mods.cpp
+++ b/src/mods.cpp
@@ -46,6 +46,7 @@ std::map<std::string, ModSpec> getModsInPath(std::string path)
modpack_is.close(); // We don't actually need the file
ModSpec spec(modname,modpath);
spec.modpack_content = getModsInPath(modpath);
+ spec.is_modpack = true;
result.insert(std::make_pair(modname,spec));
}
else // not a modpack, add the modspec
@@ -76,7 +77,7 @@ std::map<std::string, ModSpec> flattenModTree(std::map<std::string, ModSpec> mod
it != mods.end(); ++it)
{
ModSpec mod = (*it).second;
- if(!mod.modpack_content.empty()) //is a modpack
+ if(mod.is_modpack)
{
std::map<std::string, ModSpec> content =
flattenModTree(mod.modpack_content);
@@ -98,7 +99,7 @@ std::vector<ModSpec> flattenMods(std::map<std::string, ModSpec> mods)
it != mods.end(); ++it)
{
ModSpec mod = (*it).second;
- if(!mod.modpack_content.empty()) //is a modpack
+ if(mod.is_modpack)
{
std::vector<ModSpec> content = flattenMods(mod.modpack_content);
result.reserve(result.size() + content.size());