Fix privilege enforcement being useless

Privilege violations caused an error message but didn't abort the operation
master
orwell96 2017-03-16 22:04:32 +01:00
parent ba0e75a692
commit a091ac2e1d
3 changed files with 2 additions and 0 deletions

Binary file not shown.

View File

@ -58,6 +58,7 @@ end
function ac.on_receive_fields(pos, formname, fields, player)
if not minetest.check_player_privs(player:get_player_name(), {atlatc=true}) then
minetest.chat_send_player(player:get_player_name(), "Missing privilege: atlatc - Operation cancelled!")
return
end
local meta=minetest.get_meta(pos)

View File

@ -30,6 +30,7 @@ minetest.register_craftitem("advtrains_luaautomation:pcnaming",{
end
if not minetest.check_player_privs(pname, {atlatc=true}) then
minetest.chat_send_player(pname, "Missing privilege: atlatc")
return
end
if pointed_thing.type=="node" then
local pos=pointed_thing.under