From a091ac2e1da07b442c8f58237667287714adc838 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Thu, 16 Mar 2017 22:04:32 +0100 Subject: Fix privilege enforcement being useless Privilege violations caused an error message but didn't abort the operation --- advtrains.zip | Bin 4985744 -> 4985744 bytes .../advtrains_luaautomation/active_common.lua | 1 + advtrains/advtrains_luaautomation/pcnaming.lua | 1 + 3 files changed, 2 insertions(+) diff --git a/advtrains.zip b/advtrains.zip index 1f6217d..bb215bd 100644 Binary files a/advtrains.zip and b/advtrains.zip differ diff --git a/advtrains/advtrains_luaautomation/active_common.lua b/advtrains/advtrains_luaautomation/active_common.lua index 0b13a51..e17af91 100644 --- a/advtrains/advtrains_luaautomation/active_common.lua +++ b/advtrains/advtrains_luaautomation/active_common.lua @@ -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) diff --git a/advtrains/advtrains_luaautomation/pcnaming.lua b/advtrains/advtrains_luaautomation/pcnaming.lua index fbfea8a..5604749 100644 --- a/advtrains/advtrains_luaautomation/pcnaming.lua +++ b/advtrains/advtrains_luaautomation/pcnaming.lua @@ -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 -- cgit v1.2.3