diff options
author | kwolekr <kwolekr@minetest.net> | 2014-12-29 23:15:53 -0500 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2014-12-29 23:15:53 -0500 |
commit | c6df2bc42ca82eb75136112c3ad5610a42c1ea6a (patch) | |
tree | 55bc88460bef7b9a25f562fd908d02a4a6519c72 /src | |
parent | f12118c38b7fb209d2eaeb0bca406e06be2c9650 (diff) | |
download | minetest-c6df2bc42ca82eb75136112c3ad5610a42c1ea6a.tar.gz minetest-c6df2bc42ca82eb75136112c3ad5610a42c1ea6a.tar.bz2 minetest-c6df2bc42ca82eb75136112c3ad5610a42c1ea6a.zip |
Add support back for resolving group names in NodeResolver
Diffstat (limited to 'src')
-rw-r--r-- | src/nodedef.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp index f87daa528..f01a7e87b 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -1356,13 +1356,21 @@ bool CNodeDefManager::getIdsFromResolveInfo(NodeResolveInfo *nri, std::string name = nri->nodenames.front(); nri->nodenames.pop_front(); - if (getId(name, c)) { - result.push_back(c); - } else if (listinfo.all_required) { - errorstream << "Resolver: Failed to resolve node name '" << name - << "'." << std::endl; - result.push_back(listinfo.c_fallback); - success = false; + if (name.substr(0,6) != "group:") { + if (getId(name, c)) { + result.push_back(c); + } else if (listinfo.all_required) { + errorstream << "Resolver: Failed to resolve node name '" << name + << "'." << std::endl; + result.push_back(listinfo.c_fallback); + success = false; + } + } else { + std::set<content_t> cids; + std::set<content_t>::iterator it; + getIds(name, cids); + for (it = cids.begin(); it != cids.end(); ++it) + result.push_back(*it); } } |