1
0
mirror of git://repo.or.cz/minetest_schemedit.git synced 2024-11-14 11:30:17 +01:00

Make preview box non-pointable

This commit is contained in:
Wuzzy 2017-09-02 06:19:22 +02:00
parent 87ff9ea293
commit 8a1ed6adbd

View File

@ -625,7 +625,6 @@ function advschem.mark(pos)
if marker ~= nil then
marker:set_properties({
visual_size={x=(sizex+0.01) * 2, y=sizey * 2},
collisionbox = {-sizex, -sizey, -thickness, sizex, sizey, thickness},
})
marker:get_luaentity().id = id
marker:get_luaentity().owner = owner
@ -647,7 +646,6 @@ function advschem.mark(pos)
if marker ~= nil then
marker:set_properties({
visual_size={x=(sizez+0.01) * 2, y=sizey * 2},
collisionbox = {-thickness, -sizey, -sizez, thickness, sizey, sizez},
})
marker:set_yaw(math.pi / 2)
marker:get_luaentity().id = id
@ -839,14 +837,14 @@ minetest.register_node("advschem:void", {
groups = { dig_immediate = 3},
})
-- [entity] Display
-- [entity] Visible schematic border
minetest.register_entity("advschem:display", {
initial_properties = {
visual = "upright_sprite",
textures = {"advschem_border.png"},
visual_size = {x=10, y=10},
physical = false,
},
visual = "upright_sprite",
textures = {"advschem_border.png"},
visual_size = {x=10, y=10},
collisionbox = {0,0,0,0,0,0},
physical = false,
on_step = function(self, dtime)
if not self.id then
self.object:remove()
@ -854,15 +852,6 @@ minetest.register_entity("advschem:display", {
self.object:remove()
end
end,
on_punch = function(self, hitter)
local pos = minetest.string_to_pos(self.id)
local meta = minetest.get_meta(pos)
if meta:get_string("owner") == hitter:get_player_name() or
minetest.check_player_privs(hitter, "schematic_override") == true then
advschem.unmark(pos)
meta:set_string("schem_border", "false")
end
end,
on_activate = function(self)
self.object:set_armor_groups({immortal = 1})
end,