mirror of
https://github.com/minetest-mods/throwing.git
synced 2025-07-05 09:50:24 +02:00
Automatically fill the "item" field of the arrow luaentity if not existing
This commit is contained in:
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
|
||||
|
Reference in New Issue
Block a user