mirror of
https://github.com/minetest-mods/throwing.git
synced 2024-11-15 23:20:22 +01:00
Automatically fill the "item" field of the arrow luaentity if not existing
This commit is contained in:
parent
d7fae754f9
commit
df73f47285
3
init.lua
3
init.lua
|
@ -47,6 +47,9 @@ local function shoot_arrow(itemstack, player, throw_itself)
|
|||
|
||||
local luaentity = obj:get_luaentity()
|
||||
luaentity.player = player:get_player_name()
|
||||
if not luaentity.item then
|
||||
luaentity.item = arrow
|
||||
end
|
||||
|
||||
if luaentity.on_throw then
|
||||
if luaentity.on_throw(pos, player, ((player:get_wield_index()+1) % inventory:get_size("main")) + 1, luaentity.data, luaentity) == false then
|
||||
|
|
Loading…
Reference in New Issue
Block a user