fixed painting only by owner or server admin
This commit is contained in:
parent
8e6cba2238
commit
7a73f477b0
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue