From 33e9ac8e2318aebc3338e4d1440ce4744f305cc6 Mon Sep 17 00:00:00 2001 From: Sirrobzeroone <44497598+sirrobzeroone@users.noreply.github.com> Date: Tue, 22 Dec 2020 12:30:42 +1100 Subject: [PATCH] Minor improvement to fix #13 Picked up while testing #34 and #30 that this needed to be adjusted from hitter name to hitter is player. Hitter name was resolving to true even when mob was attacking...nil being counted as a value. I should have picked this up before and not sure how I missed this. --- 3d_armor/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3d_armor/init.lua b/3d_armor/init.lua index 0d7d293..ec91680 100644 --- a/3d_armor/init.lua +++ b/3d_armor/init.lua @@ -395,8 +395,8 @@ if armor.config.punch_damage == true then minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch, tool_capabilities) local name = player:get_player_name() - local name2 = hitter:get_player_name() - if name and name2 and minetest.is_protected(player:get_pos(), "") then + local hit_ip = hitter:is_player() + if name and hit_ip and minetest.is_protected(player:get_pos(), "") then return elseif name then armor:punch(player, hitter, time_from_last_punch, tool_capabilities)