mirror of
https://github.com/minetest-mods/throwing.git
synced 2025-01-09 09:40:26 +01:00
Bugfix: remove the arrow in the inventory if not in creative mode
This commit is contained in:
parent
5bd926a879
commit
98d5fc9449
2
init.lua
2
init.lua
@ -9,7 +9,7 @@ local function shoot_arrow(itemstack, player)
|
||||
for _,arrow in ipairs(throwing.arrows) do
|
||||
if player:get_inventory():get_stack("main", player:get_wield_index()+1):get_name() == arrow then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
player:get_inventory():remove_item("main", arrow[1])
|
||||
player:get_inventory():remove_item("main", arrow)
|
||||
end
|
||||
local playerpos = player:getpos()
|
||||
local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow.."_entity")
|
||||
|
Loading…
Reference in New Issue
Block a user