mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-11-22 20:43:43 +01:00
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.
This commit is contained in:
parent
06aaaf4bca
commit
33e9ac8e23
@ -395,8 +395,8 @@ if armor.config.punch_damage == true then
|
|||||||
minetest.register_on_punchplayer(function(player, hitter,
|
minetest.register_on_punchplayer(function(player, hitter,
|
||||||
time_from_last_punch, tool_capabilities)
|
time_from_last_punch, tool_capabilities)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local name2 = hitter:get_player_name()
|
local hit_ip = hitter:is_player()
|
||||||
if name and name2 and minetest.is_protected(player:get_pos(), "") then
|
if name and hit_ip and minetest.is_protected(player:get_pos(), "") then
|
||||||
return
|
return
|
||||||
elseif name then
|
elseif name then
|
||||||
armor:punch(player, hitter, time_from_last_punch, tool_capabilities)
|
armor:punch(player, hitter, time_from_last_punch, tool_capabilities)
|
||||||
|
Loading…
Reference in New Issue
Block a user