fixed painting only by owner or server admin

This commit is contained in:
Alexsandro Percy 2023-09-28 19:03:30 -03:00
parent 8e6cba2238
commit 7a73f477b0
2 changed files with 12 additions and 0 deletions

View File

@ -468,6 +468,12 @@ minetest.register_node("automobiles_lib:light", {
})
function automobiles_lib.set_paint(self, puncher, itmstck)
local is_admin = false
is_admin = minetest.check_player_privs(puncher, {server=true})
if not (self.owner == puncher:get_player_name() or is_admin == true) then
return
end
local item_name = ""
if itmstck then item_name = itmstck:get_name() end

View File

@ -254,6 +254,12 @@ local function paint(self, colstr)
end
function trans_am.set_paint(self, puncher, itmstck)
local is_admin = false
is_admin = minetest.check_player_privs(puncher, {server=true})
if not (self.owner == puncher:get_player_name() or is_admin == true) then
return
end
local item_name = ""
if itmstck then item_name = itmstck:get_name() end