Bugfix: hitter parameter for arrows and golden arrows is an ObjectRef, not a player name

This commit is contained in:
upsilon 2017-01-07 14:30:46 +01:00
parent a95f439edd
commit 5bd926a879

View File

@ -17,11 +17,11 @@ end
if get_setting("arrow") then if get_setting("arrow") then
throwing.register_arrow("arrow", "default:steel_ingot", 16, "Arrow", throwing.register_arrow("arrow", "default:steel_ingot", 16, "Arrow",
{"throwing_arrow.png", "throwing_arrow.png", "throwing_arrow_back.png", "throwing_arrow_front.png", "throwing_arrow_2.png", "throwing_arrow.png"}, "throwing_arrow", {"throwing_arrow.png", "throwing_arrow.png", "throwing_arrow_back.png", "throwing_arrow_front.png", "throwing_arrow_2.png", "throwing_arrow.png"}, "throwing_arrow",
function(pos, _, _, object, _) function(pos, _, _, object, hitter)
if not object then if not object then
return return
end end
object:punch(minetest.get_player_by_name(hitter), 1, { object:punch(hitter, 1, {
full_punch_interval = 1, full_punch_interval = 1,
damage_groups = {fleshy = 3} damage_groups = {fleshy = 3}
}) })
@ -31,11 +31,11 @@ end
if get_setting("golden_arrow") then if get_setting("golden_arrow") then
throwing.register_arrow("arrow_gold", "default:gold_ingot", 16, "Golden Arrow", throwing.register_arrow("arrow_gold", "default:gold_ingot", 16, "Golden Arrow",
{"throwing_arrow_gold.png", "throwing_arrow_gold.png", "throwing_arrow_gold_back.png", "throwing_arrow_gold_front.png", "throwing_arrow_gold_2.png", "throwing_arrow_gold.png"}, "throwing_arrow", {"throwing_arrow_gold.png", "throwing_arrow_gold.png", "throwing_arrow_gold_back.png", "throwing_arrow_gold_front.png", "throwing_arrow_gold_2.png", "throwing_arrow_gold.png"}, "throwing_arrow",
function(pos, last_pos, node, object, hitter) function(pos, _, _, object, hitter)
if not object then if not object then
return return
end end
object:punch(minetest.get_player_by_name(hitter), 1, { object:punch(hitter, 1, {
full_punch_interval = 1, full_punch_interval = 1,
damage_groups = {fleshy = 5} damage_groups = {fleshy = 5}
}) })