Fix more protection mechanics

- Report violation on scaling
- Prevent optic rotation
This commit is contained in:
Aaron Suen 2020-06-30 23:48:21 -04:00
parent e34ce24d74
commit 544b306660
2 changed files with 13 additions and 2 deletions

View File

@ -310,6 +310,12 @@ function nodecore.node_spin_custom(...)
local qty = #arr
return function(pos, node, clicker, itemstack)
if clicker and clicker:is_player()
and minetest.is_protected(pos, clicker:get_player_name()) then
minetest.record_protection_violation(pos, clicker:get_player_name())
return
end
node = node or minetest.get_node(pos)
node.param2 = lut[node.param2] or lut[false]
if clicker:is_player() then

View File

@ -69,8 +69,13 @@ local function tryreplace(pos, newname, rootpos)
end
function nodecore.scaling_apply(pointed, player)
if pointed.type ~= "node" or (not pointed.above) or (not pointed.under)
or minetest.is_protected(pointed.above, player:get_player_name()) then return end
if pointed.type ~= "node" or (not pointed.above) or (not pointed.under) then return end
if player and player:is_player()
and minetest.is_protected(pointed.above, player:get_player_name()) then
minetest.record_protection_violation(pointed.above, player:get_player_name())
return
end
local pos = pointed.above
if pointed.under.y > pointed.above.y and issolid(pointed.under) then