1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-23 07:10:19 +01:00

Doors: Prevent placement in protected areas.

https://forum.minetest.net/viewtopic.php?f=42&t=1523&start=500#p208773

Currently, doors can be placed inside others' protected areas. We
need to check protection for both bottom and top halves.
This commit is contained in:
Auke Kok 2016-02-29 08:35:36 -08:00 committed by sfan5
parent 5d28040915
commit 00a0d9a5d4

View File

@ -235,6 +235,11 @@ function doors.register(name, def)
return itemstack return itemstack
end end
local pn = placer:get_player_name()
if minetest.is_protected(pos, pn) or minetest.is_protected(above, pn) then
return itemstack
end
local dir = minetest.dir_to_facedir(placer:get_look_dir()) local dir = minetest.dir_to_facedir(placer:get_look_dir())
local ref = { local ref = {