diff options
author | Robert Zenz <Robert.Zenz@bonsaimind.org> | 2015-11-05 19:56:19 +0100 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-11-12 00:47:11 +0100 |
commit | 0876623aedcd93100103d145788affcb5001bdaf (patch) | |
tree | 5d7686e5cd9ba764034361070e3db1a0b53050f9 /builtin/game/item.lua | |
parent | 76c9abe4c89f6c8170b82558182837259efdd2ea (diff) | |
download | minetest-0876623aedcd93100103d145788affcb5001bdaf.tar.gz minetest-0876623aedcd93100103d145788affcb5001bdaf.tar.bz2 minetest-0876623aedcd93100103d145788affcb5001bdaf.zip |
Add the player name to dropped items
The player name is now added in the field "dropped_by" on the created
entity.
Diffstat (limited to 'builtin/game/item.lua')
-rw-r--r-- | builtin/game/item.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/game/item.lua b/builtin/game/item.lua index df5bb070d..44ec35cc9 100644 --- a/builtin/game/item.lua +++ b/builtin/game/item.lua @@ -348,7 +348,7 @@ function core.item_place(itemstack, placer, pointed_thing, param2) end function core.item_drop(itemstack, dropper, pos) - if dropper.is_player then + if dropper and dropper:is_player() then local v = dropper:get_look_dir() local p = {x=pos.x, y=pos.y+1.2, z=pos.z} local cs = itemstack:get_count() @@ -362,6 +362,7 @@ function core.item_drop(itemstack, dropper, pos) v.y = v.y*2 + 2 v.z = v.z*2 obj:setvelocity(v) + obj:get_luaentity().dropped_by = dropper:get_player_name() return itemstack end |