Make the normal arrow able to press mesecons buttons

Fixes Mynetest/Mynetest-server#80
This commit is contained in:
upsilon 2017-03-05 14:29:49 +01:00
parent 6de69cdf76
commit 33bc0b5f69
No known key found for this signature in database
GPG Key ID: A80DAE1F266E1C3C
2 changed files with 14 additions and 6 deletions

View File

@ -1,2 +1,4 @@
default default
farming farming
mesecons?
mesecons_button?

View File

@ -44,13 +44,19 @@ if get_setting("arrow") then
craft_quantity = 16, craft_quantity = 16,
description = "Arrow", description = "Arrow",
tiles = {"throwing_arrow.png", "throwing_arrow.png", "throwing_arrow_back.png", "throwing_arrow_front.png", "throwing_arrow_2.png", "throwing_arrow.png"}, tiles = {"throwing_arrow.png", "throwing_arrow.png", "throwing_arrow_back.png", "throwing_arrow_front.png", "throwing_arrow_2.png", "throwing_arrow.png"},
target = throwing.target_object, target = throwing.target_both,
on_hit_sound = "throwing_arrow", on_hit_sound = "throwing_arrow",
on_hit = function(pos, _, _, object, hitter) on_hit = function(pos, _, node, object, hitter)
if object then
object:punch(hitter, 1, { object:punch(hitter, 1, {
full_punch_interval = 1, full_punch_interval = 1,
damage_groups = {fleshy = 3} damage_groups = {fleshy = 3}
}) })
elseif node then
if node.name == "mesecons_button:button_off" and minetest.get_modpath("mesecons_button") and minetest.get_modpath("mesecons") then
minetest.registered_items["mesecons_button:button_off"].on_rightclick(vector.round(pos), node)
end
end
end end
}) })
end end