diff options
author | ShadowNinja <noreply@gmail.com> | 2013-04-14 03:01:27 -0400 |
---|---|---|
committer | PilzAdam <pilzadam@minetest.net> | 2013-05-20 13:43:13 +0200 |
commit | 127c48835573f9e7bd89137ecb2176c2a8e5f783 (patch) | |
tree | 8964b12dfd2079d2525e6860e4c659dc3fd592e1 /src | |
parent | 981c6c9bf249f15945ca63c34d78d8c5a81ce469 (diff) | |
download | minetest-127c48835573f9e7bd89137ecb2176c2a8e5f783.tar.gz minetest-127c48835573f9e7bd89137ecb2176c2a8e5f783.tar.bz2 minetest-127c48835573f9e7bd89137ecb2176c2a8e5f783.zip |
Use the group "soil" for nodes that saplings grow on
Diffstat (limited to 'src')
-rw-r--r-- | src/content_abm.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/content_abm.cpp b/src/content_abm.cpp index e20201dcf..f19caf74e 100644 --- a/src/content_abm.cpp +++ b/src/content_abm.cpp @@ -99,14 +99,10 @@ class MakeTreesFromSaplingsABM : public ActiveBlockModifier { private: content_t c_junglesapling; - content_t c_dirt; - content_t c_dirt_with_grass; public: MakeTreesFromSaplingsABM(ServerEnvironment *env, INodeDefManager *nodemgr) { - c_junglesapling = nodemgr->getId("junglesapling"); - c_dirt = nodemgr->getId("mapgen_dirt"); - c_dirt_with_grass = nodemgr->getId("mapgen_dirt_with_grass"); + c_junglesapling = nodemgr->getId("junglesapling"); } virtual std::set<std::string> getTriggerContents() @@ -127,8 +123,7 @@ public: ServerMap *map = &env->getServerMap(); MapNode n_below = map->getNodeNoEx(p - v3s16(0, 1, 0)); - if (n_below.getContent() != c_dirt && - n_below.getContent() != c_dirt_with_grass) + if (!((ItemGroupList) ndef->get(n_below).groups)["soil"]) return; bool is_jungle_tree = n.getContent() == c_junglesapling; |