aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2016-10-08 14:33:21 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2016-10-08 14:33:21 +0200
commitc936b824d6453cf942e30e423c0de28b7018f782 (patch)
treeceb92bbb4b16767d898b11c8837a4e41c369f905
parent0a4af9b99e8e79e6899a02a984b53fa46c729cc5 (diff)
downloadadvtrains-c936b824d6453cf942e30e423c0de28b7018f782.tar.gz
advtrains-c936b824d6453cf942e30e423c0de28b7018f782.tar.bz2
advtrains-c936b824d6453cf942e30e423c0de28b7018f782.zip
Fixed bug with protections
-rw-r--r--trackplacer.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/trackplacer.lua b/trackplacer.lua
index e1033a4..8ff9a63 100644
--- a/trackplacer.lua
+++ b/trackplacer.lua
@@ -177,10 +177,14 @@ function tp.register_track_placer(nnprefix, imgprefix, dispname)
wield_image = imgprefix.."_placer.png",
groups={},
on_place = function(itemstack, placer, pointed_thing)
+ local name = placer:get_player_name()
+ if not name then
+ return itemstack
+ end
if pointed_thing.type=="node" then
local pos=pointed_thing.above
local upos=pointed_thing.under
- if minetest.is_protected(pos,placer) and minetest.is_protected(upos,placer) then
+ if minetest.is_protected(pos,name) and minetest.is_protected(upos,name) then
return itemstack
end
if minetest.registered_nodes[minetest.get_node(pos).name] and minetest.registered_nodes[minetest.get_node(pos).name].buildable_to