From 5bd926a879deb7c13a6fdefa037f0b1859e3d5a9 Mon Sep 17 00:00:00 2001 From: upsilon Date: Sat, 7 Jan 2017 14:30:46 +0100 Subject: [PATCH] Bugfix: hitter parameter for arrows and golden arrows is an ObjectRef, not a player name --- registration.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/registration.lua b/registration.lua index 731b1a2..13d8213 100644 --- a/registration.lua +++ b/registration.lua @@ -17,11 +17,11 @@ end if get_setting("arrow") then 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", - function(pos, _, _, object, _) + function(pos, _, _, object, hitter) if not object then return end - object:punch(minetest.get_player_by_name(hitter), 1, { + object:punch(hitter, 1, { full_punch_interval = 1, damage_groups = {fleshy = 3} }) @@ -31,11 +31,11 @@ end if get_setting("golden_arrow") then 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", - function(pos, last_pos, node, object, hitter) + function(pos, _, _, object, hitter) if not object then return end - object:punch(minetest.get_player_by_name(hitter), 1, { + object:punch(hitter, 1, { full_punch_interval = 1, damage_groups = {fleshy = 5} })