fix incorrect assumpton about math.random()
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Sun, 27 Oct 2013 06:11:32 +0000 (02:11 -0400)
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Sun, 27 Oct 2013 06:11:32 +0000 (02:11 -0400)
leafdecay.lua

index f1b80218d72a068ffd20cbfb66eb83ea97e6571a..f77f8ddc4f40af2029ad1a691e4a50a0bc1b4a45 100644 (file)
@@ -15,9 +15,9 @@ local process_drops = function(pos, name)
        for _,dropitem in ipairs(drops) do
                if dropitem ~= name then
                        local newpos = {
-                                               x=pos.x + math.random(0, 0.5),
-                                               y=pos.y + math.random(0, 0.5),
-                                               z=pos.z + math.random(0, 0.5)
+                                               x=pos.x + math.random() - 0.5,
+                                               y=pos.y + math.random() - 0.5,
+                                               z=pos.z + math.random() - 0.5
                                        }
                        minetest.add_item(newpos, dropitem)
                end