1
0
mirror of https://github.com/D00Med/scifi_nodes.git synced 2024-12-22 16:10:18 +01:00

Merge pull request #27 from OgelGames/master

Make doors top not diggable
This commit is contained in:
Thomas Rudin 2019-12-11 21:03:31 +01:00 committed by GitHub
commit d1f0a8f1cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -265,6 +265,10 @@ for _, current_door in ipairs(doors) do
}, },
} }
local function nodig(pos, digger)
return false
end
local doors_rightclick = nil -- Crashes serv if empty table ! local doors_rightclick = nil -- Crashes serv if empty table !
if not scifi_nodes.doors_open_with_mesecon_only then doors_rightclick = open_door end if not scifi_nodes.doors_open_with_mesecon_only then doors_rightclick = open_door end
@ -327,6 +331,7 @@ for _, current_door in ipairs(doors) do
{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0},
} }
}, },
can_dig = nodig,
}) })
minetest.register_node(opened, { minetest.register_node(opened, {
@ -355,9 +360,9 @@ for _, current_door in ipairs(doors) do
{-0.5, -0.5, -0.0625, -0.25, 1.5, 0.0625}, {-0.5, -0.5, -0.0625, -0.25, 1.5, 0.0625},
} }
}, },
after_place_node = afterplace, after_place_node = afterplace,
after_destruct = afterdestruct, after_destruct = afterdestruct,
on_timer = ontimer, on_timer = ontimer,
}) })
minetest.register_node(opened_top, { minetest.register_node(opened_top, {
@ -385,5 +390,6 @@ for _, current_door in ipairs(doors) do
{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0},
} }
}, },
can_dig = nodig,
}) })
end -- end of doors table browsing end -- end of doors table browsing