Allow players to hit themselves.

Some mods make players hit themselves when they use certain items.
master
upsilon 2020-05-03 11:54:10 +02:00
parent 06fd54342e
commit b84810f6c3
1 changed files with 4 additions and 0 deletions

View File

@ -134,6 +134,10 @@ minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch,
local localname = player:get_player_name()
local hittername = hitter:get_player_name()
if localname == hittername then
return false
end
if not pvptable[localname].state then
minetest.chat_send_player(hittername, string.format(S("You can't hit %s because their PvP is disabled."), localname))
return true