From aa0c132570cd733da6c1d854b129746a8734e4f9 Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Wed, 17 Jun 2015 18:07:31 +0200 Subject: [PATCH] Used a deffered generation of 2 seconds for cherry trees - (hopefully) Solves #92 --- minetestforfun_game/mods/default/trees.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/minetestforfun_game/mods/default/trees.lua b/minetestforfun_game/mods/default/trees.lua index 3dd93604..87c53f96 100755 --- a/minetestforfun_game/mods/default/trees.lua +++ b/minetestforfun_game/mods/default/trees.lua @@ -366,7 +366,11 @@ minetest.register_on_generated(function(minp, maxp, seed) local p_pos = area:index(x,y,z) local content_id = data[p_pos] if content_id == c_mg_cherry_sapling then - default.grow_cherry_tree({x=x, y=y, z=z}, false, "default:cherry_tree", "default:cherry_blossom_leaves") + minetest.after(1, default.grow_cherry_tree, + {x=x, y=y, z=z}, + false, + "default:cherry_tree", + "default:cherry_blossom_leaves") trees_grown = trees_grown + 1 else -- nope @@ -375,7 +379,7 @@ minetest.register_on_generated(function(minp, maxp, seed) end end local geninfo = string.format(" trees grown after: %.2fs", os.clock() - timer) - print (trees_grown..geninfo) + minetest.log("action", trees_grown..geninfo) end) function default.grow_cherry_tree(pos, is_apple_tree, trunk_node, leaves_node)