ignore protection to destoy when is an admin doing it

This commit is contained in:
Alexsandro Percy 2024-03-03 12:14:03 -03:00
parent e0e77ed680
commit ed43997bea

View file

@ -685,10 +685,12 @@ function airutils.on_punch(self, puncher, ttime, toolcaps, dir, damage)
if is_admin == false then return end if is_admin == false then return end
end end
if is_admin == false and minetest.check_player_privs(puncher, {protection_bypass=false}) then
if self.driver_name and self.driver_name ~= name then if self.driver_name and self.driver_name ~= name then
-- do not allow other players to remove the object while there is a driver -- do not allow other players to remove the object while there is a driver
return return
end end
end
local is_attached = false local is_attached = false
local player_attach = puncher:get_attach() local player_attach = puncher:get_attach()