diff options
author | orwell96 <mono96.mml@gmail.com> | 2017-04-02 17:07:58 +0200 |
---|---|---|
committer | orwell96 <mono96.mml@gmail.com> | 2017-04-02 17:07:58 +0200 |
commit | 0447e43be9533197cb61bf6a24c384d78066de24 (patch) | |
tree | fcaf9caa548824077afb59e42cebcfd42f170c63 | |
parent | 327b12d488a7f001e21826a5b9e1df03af44c7ae (diff) | |
download | advtrains-0447e43be9533197cb61bf6a24c384d78066de24.tar.gz advtrains-0447e43be9533197cb61bf6a24c384d78066de24.tar.bz2 advtrains-0447e43be9533197cb61bf6a24c384d78066de24.zip |
Actually check for protection when placing trains and use the train_place privilege
-rw-r--r-- | advtrains.zip | bin | 4986367 -> 4986418 bytes | |||
-rw-r--r-- | advtrains/advtrains/wagons.lua | 4 |
2 files changed, 4 insertions, 0 deletions
diff --git a/advtrains.zip b/advtrains.zip Binary files differindex 0a9a0ec..e032ace 100644 --- a/advtrains.zip +++ b/advtrains.zip diff --git a/advtrains/advtrains/wagons.lua b/advtrains/advtrains/wagons.lua index 641b8b4..1074dc1 100644 --- a/advtrains/advtrains/wagons.lua +++ b/advtrains/advtrains/wagons.lua @@ -847,6 +847,10 @@ function advtrains.register_wagon(sysname, prototype, desc, inv_img) atprint("no track here, not placing.")
return itemstack
end
+ if not minetest.check_player_privs(placer, {train_place = true }) and minetest.is_protected(pointed_thing.under, placer:get_player_name()) then
+ minetest.record_protection_violation(pointed_thing.under, placer:get_player_name())
+ return
+ end
local conn1=advtrains.get_track_connections(node.name, node.param2)
local id=advtrains.create_new_train_at(pointed_thing.under, advtrains.dirCoordSet(pointed_thing.under, conn1))
|