master
root 2021-01-11 21:29:24 +01:00
parent 1cd9adcf25
commit 83db67251e
1 changed files with 3 additions and 3 deletions

View File

@ -300,13 +300,13 @@ local function pickpocketing(clicker, clicked)
end
end
p2p.register_on_right_clickplayer(function(clicker, clicked)
minetest.register_on_rightclickplayer(function(player, clicker)
local controls = clicker:get_player_control()
if controls.sneak and not(is_stealing(clicker)) then
if not(check_distance(clicker, clicked)) then
if not(check_distance(clicker, player)) then
minetest.chat_send_player(clicker:get_player_name(), S("Too far to steal!"))
return
end
pickpocketing(clicker, clicked)
pickpocketing(clicker, player)
end
end)