diff --git a/trunks/generating.lua b/trunks/generating.lua index eeb635c..f693df6 100644 --- a/trunks/generating.lua +++ b/trunks/generating.lua @@ -44,7 +44,7 @@ abstract_trunks.place_twig = function(pos) -- small twigs if twig_size <= 16 then - minetest.swap_node(right_here, {name="trunks:twig_"..random(1,4), param2=random(0,3)}) + minetest.swap_node(right_here, {name="trunks:twig_"..math.random(1,4), param2=math.random(0,3)}) end -- big twigs if Big_Twigs == true then @@ -163,7 +163,7 @@ abstract_trunks.place_twig = function(pos) end end elseif twig_size <= 25 then - minetest.swap_node(right_here, {name="trunks:twig_"..random(12,13), param2=random(0,3)}) + minetest.swap_node(right_here, {name="trunks:twig_"..math.random(12,13), param2=math.random(0,3)}) end end end @@ -270,10 +270,10 @@ abstract_trunks.place_trunk = function(pos) local MoD = TRuNKS[i][1] local TRuNK = TRuNKS[i][2] local NR = TRuNKS[i][3] - local chance = random(1, 17) - local length = random(3,5) + local chance = math.random(1, 17) + local length = math.random(3,5) if chance == NR then - local trunk_type = random(1,3) + local trunk_type = math.random(1,3) if trunk_type == 1 then if minetest.get_modpath(MoD) ~= nil then minetest.swap_node(right_here, {name=MoD..":"..TRuNK}) @@ -509,7 +509,7 @@ end if Roots == true then -- see settings.txt abstract_trunks.grow_roots = function(pos) - local twig_size = random(1,27) + local twig_size = math.random(1,27) local right_here = {x=pos.x , y=pos.y , z=pos.z } local below = {x=pos.x , y=pos.y-1, z=pos.z }