Play reload sound when loading prefered arrows

This commit is contained in:
stujones11 2015-01-30 19:44:52 +00:00
parent 12362a21e2
commit 3539ebeed0

View file

@ -237,6 +237,7 @@ minetest.register_tool("shooter:crossbow", {
local stack = inv:get_stack("main", user:get_wield_index() + 1)
local color = string.match(stack:get_name(), "shooter:arrow_(%a+)")
if color then
minetest.sound_play("shooter_reload", {object=user})
if not minetest.setting_getbool("creative_mode") then
inv:remove_item("main", "shooter:arrow_"..color.." 1")
end