power line protection bugfix

This commit is contained in:
Joachim Stolberg 2019-09-07 10:42:18 +02:00
parent 56ed4ccad0
commit 5911dcadbe
2 changed files with 3 additions and 3 deletions

View File

@ -186,11 +186,11 @@ minetest.register_node("techage:power_pole", {
},
},
after_place_node = function(pos, placer, itemstack, pointed_thing)
M(pos):set_string("owner", placer:get_player_name())
if techage.is_protected(pos, placer:get_player_name()) then
minetest.remove_node(pos)
return true
end
M(pos):set_string("owner", placer:get_player_name())
end,
can_dig = function(pos, digger)
local meta = minetest.get_meta(pos)
@ -235,6 +235,7 @@ minetest.register_node("techage:power_pole2", {
end,
after_place_node = function(pos, placer, itemstack, pointed_thing)
M(pos):set_string("owner", placer:get_player_name())
if techage.is_protected(pos, placer:get_player_name()) then
minetest.remove_node(pos)
return true
@ -243,7 +244,6 @@ minetest.register_node("techage:power_pole2", {
minetest.remove_node(pos)
return true
end
M(pos):set_string("owner", placer:get_player_name())
return false
end,
can_dig = function(pos, digger)

View File

@ -20,7 +20,7 @@ local IsNodeUnderObservation = {}
-- Register all nodes, which should be protected by the "techage:power_pole"
function techage.register_powerline_node(name)
IsNodeUnderObservation[name] = true
IsNodeUnderObservation[name] = true
end
local function powerpole_found(pos, name, range)