aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-01-09 22:04:25 +0100
committerorwell96 <orwell@bleipb.de>2018-01-09 22:04:25 +0100
commit7507dbba3ae566a6175ad0f63bb599144534e4ee (patch)
treee8fc3a0b4c23c2aa7f5e85766a2290c95b0a83ca
parent79da249c3d32769f7f3821292d479e6e44fdcb31 (diff)
downloadadvtrains-7507dbba3ae566a6175ad0f63bb599144534e4ee.tar.gz
advtrains-7507dbba3ae566a6175ad0f63bb599144534e4ee.tar.bz2
advtrains-7507dbba3ae566a6175ad0f63bb599144534e4ee.zip
Add train_operator privilege check on discouple
-rw-r--r--advtrains/wagons.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua
index 42466f3..0506a22 100644
--- a/advtrains/wagons.lua
+++ b/advtrains/wagons.lua
@@ -1105,6 +1105,10 @@ function wagon:reattach_all()
end
function wagon:safe_decouple(pname)
+ if not minetest.check_player_privs(pname, "train_operator") then
+ minetest.chat_send_player(pname, "Missing train_operator privilege")
+ return false
+ end
if self.dcpl_lock then
minetest.chat_send_player(pname, "Couple is locked (ask owner or admin to unlock it)")
return false