Skip to content

Commit

Permalink
Minor improvement to fix minetest-mods#13
Browse files Browse the repository at this point in the history
Picked up while testing  minetest-mods#34 and minetest-mods#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.
  • Loading branch information
sirrobzeroone committed Dec 22, 2020
1 parent 06aaaf4 commit 6173271
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 3d_armor/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6173271

Please sign in to comment.