summaryrefslogtreecommitdiff
path: root/lua/api.lua
diff options
context:
space:
mode:
authorLNJ <git@lnj.li>2017-04-03 13:00:40 +0200
committerLNJ <git@lnj.li>2017-04-05 14:53:16 +0200
commita53dac2929a2e8b4fa8b07840f0bf0f7a9e367b3 (patch)
tree20ebd064be3c42017cdc1394e538d8277e30da9e /lua/api.lua
parent69a974cb6be690ae71d011f5764472e4e0bccc54 (diff)
Randomize drop pos
Diffstat (limited to 'lua/api.lua')
-rwxr-xr-xlua/api.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/lua/api.lua b/lua/api.lua
index bf8c8c8..dafb934 100755
--- a/lua/api.lua
+++ b/lua/api.lua
@@ -98,10 +98,11 @@ function drawers.drawer_on_dig(pos, node, player)
local j = math.floor(count / stack_max) + 1
local i = 1
while i <= j do
+ rndpos = drawers.randomize_pos(pos)
if not (i == j) then
- core.add_item(pos, name .. " " .. stack_max)
+ core.add_item(rndpos, name .. " " .. stack_max)
else
- core.add_item(pos, name .. " " .. count % stack_max)
+ core.add_item(rndpos, name .. " " .. count % stack_max)
end
i = i + 1
end