aboutsummaryrefslogtreecommitdiff
path: root/advtrains/protection.lua
diff options
context:
space:
mode:
authorY. Wang <yw05@forksworld.de>2022-11-02 15:08:21 +0100
committerY. Wang <yw05@forksworld.de>2022-11-02 15:08:21 +0100
commit7dea2eba5816e1d7af7b1002c3b4f177ec9b15b5 (patch)
treef2bf25056ff8521bb64f21d937c16bad79ee82cd /advtrains/protection.lua
parenta6fc6497e7f187f8fac1d72d826ac893b689f2f6 (diff)
downloadadvtrains-7dea2eba5816e1d7af7b1002c3b4f177ec9b15b5.tar.gz
advtrains-7dea2eba5816e1d7af7b1002c3b4f177ec9b15b5.tar.bz2
advtrains-7dea2eba5816e1d7af7b1002c3b4f177ec9b15b5.zip
Add helper for "insufficient privileges" messages
BREAKING: attrans is now implemented as a table with the __call metamethod instead of as a function
Diffstat (limited to 'advtrains/protection.lua')
-rw-r--r--advtrains/protection.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/advtrains/protection.lua b/advtrains/protection.lua
index cca54a9..83ead86 100644
--- a/advtrains/protection.lua
+++ b/advtrains/protection.lua
@@ -145,12 +145,12 @@ function advtrains.check_track_protection(pos, pname, near, prot_p)
--atdebug("CTP: ",pos,pname,near,prot_p,"priv=",priv,"prot=",prot,"dprot=",dprot)
if not priv and (not boo or prot or not dprot) then
- minetest.chat_send_player(pname, attrans("You are not allowed to build "..nears.."tracks without the track_builder privilege"))
+ minetest.chat_send_player(pname, attrans.nopriv("track_builder", "build "..nears.."tracks"))
minetest.log("action", pname.." tried to modify terrain "..nears.."track at "..minetest.pos_to_string(apos).." but is not permitted to (no privilege)")
return false
end
if prot then
- minetest.chat_send_player(pname, attrans("You are not allowed to build "..nears.."tracks at this protected position"))
+ minetest.chat_send_player(pname, attrans("You are not allowed to build "..nears.."tracks at this protected position."))
minetest.record_protection_violation(pos, pname)
minetest.log("action", pname.." tried to modify "..nears.."track at "..minetest.pos_to_string(apos).." but position is protected!")
return false
@@ -181,7 +181,7 @@ function advtrains.check_turnout_signal_protection(pos, pname)
nocheck=false
return true
else
- minetest.chat_send_player(pname, attrans("You are not allowed to operate turnouts and signals (missing railway_operator privilege)"))
+ minetest.chat_send_player(pname, attrans.nopriv("railway_operator", "operate turnouts and signals"))
minetest.log("action", pname.." tried to operate turnout/signal at "..minetest.pos_to_string(pos).." but does not have railway_operator")
nocheck=false
return false