aboutsummaryrefslogtreecommitdiff
path: root/advtrains/protection.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2025-05-27 21:03:14 +0200
committerorwell <orwell@bleipb.de>2025-05-27 21:03:14 +0200
commit8506dd2825b715293138976a5ad1fa11a46206a7 (patch)
tree1f48c1dc03c3bbc6ed6762bd04d10e543a3a580c /advtrains/protection.lua
parent2a9891577c1b00068cc4ec858c7dc6c5196f0a2b (diff)
parentadc01a0bba29b40278e45c50caa954c435374f7b (diff)
downloadadvtrains-8506dd2825b715293138976a5ad1fa11a46206a7.tar.gz
advtrains-8506dd2825b715293138976a5ad1fa11a46206a7.tar.bz2
advtrains-8506dd2825b715293138976a5ad1fa11a46206a7.zip
Merge branch 'master' into cesky-hvozd
Throw away most of the changes in everything except line_automation. Merge line_automation changes between CH and master
Diffstat (limited to 'advtrains/protection.lua')
-rw-r--r--advtrains/protection.lua25
1 files changed, 3 insertions, 22 deletions
diff --git a/advtrains/protection.lua b/advtrains/protection.lua
index 36f4192..ac1cd66 100644
--- a/advtrains/protection.lua
+++ b/advtrains/protection.lua
@@ -25,13 +25,6 @@ minetest.register_privilege("railway_operator", {
give_to_singleplayer= true,
});
--- Other privileges
-minetest.register_privilege("train_ghost", {
- description = "Poskytuje imunitu proti sražení vlakem.",
- give_to_singleplayer = false,
-});
-
-
-- there is a configuration option "allow_build_only_owner". If this is active, a player having track_builder can only build rails and operate signals/turnouts in an area explicitly belonging to him
-- (checked using a dummy player called "*dummy*" (which is not an allowed player name))
@@ -152,24 +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
- local s
- if near then
- s = "Nemůžete stavět poblíž kolejí, protože vám chybí právo track_builder. Pokud toto právo chcete, domluvte se s Administrací."
- else
- s = "Nemůžete stavět koleje, protože vám chybí právo track_builder. Pokud toto právo chcete, domluvte se s Administrací."
- end
- minetest.chat_send_player(pname, s)
+ minetest.chat_send_player(pname, near and attrans("You are not allowed to build near tracks without the track_builder privilege.") or attrans("You are not allowed to build tracks without the track_builder privilege."))
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
- local s
- if near then
- s = "Zde nemůžete stavět, protože oblast je zastřežena!"
- else
- s = "Zde nemůžete stavět koleje, protože oblast je zastřežena!"
- end
- minetest.chat_send_player(pname, s)
+ minetest.chat_send_player(pname, near and attrans("You are not allowed to build near tracks at this protected position.") or attrans("You are not allowed to build 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
@@ -200,7 +181,7 @@ function advtrains.check_turnout_signal_protection(pos, pname)
nocheck=false
return true
else
- minetest.chat_send_player(pname, "Nemůžete ovládat výhybky a návěstidla. (požadované právo: railway_operator)")
+ minetest.chat_send_player(pname, attrans("You are not allowed to operate turnouts and signals without the railway_operator privilege."))
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