diff options
Diffstat (limited to 'builtin/item.lua')
-rw-r--r-- | builtin/item.lua | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/builtin/item.lua b/builtin/item.lua index 3abf30a6d..678a5cdac 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -192,7 +192,17 @@ function minetest.item_place(itemstack, placer, pointed_thing) end function minetest.item_drop(itemstack, dropper, pos) - minetest.env:add_item(pos, itemstack) + if dropper.get_player_name then + local v = dropper:get_look_dir() + local p = {x=pos.x+v.x, y=pos.y+1.5+v.y, z=pos.z+v.z} + local obj = minetest.env:add_item(p, itemstack) + v.x = v.x*2 + v.y = v.y*2 + 1 + v.z = v.z*2 + obj:setvelocity(v) + else + minetest.env:add_item(pos, itemstack) + end return "" end @@ -377,4 +387,3 @@ minetest.noneitemdef_default = { -- This is used for the hand and unknown items on_use = nil, } - |