aboutsummaryrefslogtreecommitdiff
path: root/advtrains/trackplacer.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-11-12 22:24:56 +0100
committerorwell96 <orwell@bleipb.de>2018-11-12 22:24:56 +0100
commit5874a6d3f4e8668ac790d7882b5fe85fd20125a0 (patch)
tree446b606193ceccf1c701efdbd48b81817900a118 /advtrains/trackplacer.lua
parent07fa21f9929d0d36c13aefe83a91b5d250e7fea9 (diff)
downloadadvtrains-5874a6d3f4e8668ac790d7882b5fe85fd20125a0.tar.gz
advtrains-5874a6d3f4e8668ac790d7882b5fe85fd20125a0.tar.bz2
advtrains-5874a6d3f4e8668ac790d7882b5fe85fd20125a0.zip
Fix protection regarding tracks (track_builder and railway_operator) and documentation on privileges
Diffstat (limited to 'advtrains/trackplacer.lua')
-rw-r--r--advtrains/trackplacer.lua11
1 files changed, 4 insertions, 7 deletions
diff --git a/advtrains/trackplacer.lua b/advtrains/trackplacer.lua
index 427a20e..9f5fadd 100644
--- a/advtrains/trackplacer.lua
+++ b/advtrains/trackplacer.lua
@@ -277,8 +277,7 @@ function tp.register_track_placer(nnprefix, imgprefix, dispname)
if pointed_thing.type=="node" then
local pos=pointed_thing.above
local upos=vector.subtract(pointed_thing.above, {x=0, y=1, z=0})
- if advtrains.is_protected(pos,name) then
- minetest.record_protection_violation(pos, name)
+ if not advtrains.check_track_protection(pos, name) then
return itemstack, false
end
if minetest.registered_nodes[minetest.get_node(pos).name] and minetest.registered_nodes[minetest.get_node(pos).name].buildable_to
@@ -286,7 +285,7 @@ function tp.register_track_placer(nnprefix, imgprefix, dispname)
-- minetest.chat_send_all(nnprefix)
local yaw = placer:get_look_horizontal()
tp.placetrack(pos, nnprefix, placer, itemstack, pointed_thing, yaw)
- if not minetest.settings:get_bool("creative_mode") then
+ if not advtrains.is_creative(name) then
itemstack:take_item()
end
end
@@ -314,8 +313,7 @@ minetest.register_craftitem("advtrains:trackworker",{
local has_aux1_down = placer:get_player_control().aux1
if pointed_thing.type=="node" then
local pos=pointed_thing.under
- if advtrains.is_protected(pos, name) then
- minetest.record_protection_violation(pos, name)
+ if not advtrains.check_track_protection(pos, name) then
return
end
local node=minetest.get_node(pos)
@@ -369,8 +367,7 @@ minetest.register_craftitem("advtrains:trackworker",{
if pointed_thing.type=="node" then
local pos=pointed_thing.under
local node=minetest.get_node(pos)
- if advtrains.is_protected(pos, name) then
- minetest.record_protection_violation(pos, name)
+ if not advtrains.check_track_protection(pos, name) then
return
end