mirror of
https://bitbucket.org/Infinatum/scaffolding.git
synced 2025-01-09 16:40:17 +01:00
Removed Debug Test
This commit is contained in:
parent
2ec270e1a1
commit
9e47250b38
18
init.lua
18
init.lua
@ -22,25 +22,20 @@ local buildScaffolding = function(node, pos, itemstack, player)
|
|||||||
-- code for the building scaffolding
|
-- code for the building scaffolding
|
||||||
height = 0;
|
height = 0;
|
||||||
depth = 0; -- !!Note!! depth is not needed at the moment
|
depth = 0; -- !!Note!! depth is not needed at the moment
|
||||||
minetest.chat_send_all(string.format("Hello"))
|
|
||||||
|
|
||||||
--[[ debug stuff ]]
|
--[[ debug stuff ]]
|
||||||
minetest.chat_send_all(string.format("node: %s",name))
|
|
||||||
|
|
||||||
minetest.chat_send_all(string.format("node: %s %s %s ",pos.x, pos.y, pos.z ))
|
|
||||||
|
|
||||||
-- set pos at bottom of scafolding tower.
|
-- set pos at bottom of scafolding tower.
|
||||||
repeat
|
repeat
|
||||||
pos.y = pos.y - 1; --every run get one node up
|
pos.y = pos.y - 1; --every run get one node up
|
||||||
depth = depth - 1
|
depth = depth - 1
|
||||||
local current_node = minetest.get_node(pos); --get the node of the new position
|
local current_node = minetest.get_node(pos); --get the node of the new position
|
||||||
minetest.chat_send_all(string.format("found %q at location: %s",
|
|
||||||
current_node.name,
|
|
||||||
minetest.pos_to_string(pos)
|
|
||||||
))
|
|
||||||
|
|
||||||
until current_node.name ~= node -- will repeat untill it dose not find a scaffolding node
|
until current_node.name ~= node -- will repeat untill it dose not find a scaffolding node
|
||||||
minetest.chat_send_all(string.format("exit loop"))
|
|
||||||
|
|
||||||
-- check height of scaffolding tower --
|
-- check height of scaffolding tower --
|
||||||
|
|
||||||
@ -48,10 +43,7 @@ local buildScaffolding = function(node, pos, itemstack, player)
|
|||||||
pos.y = pos.y + 1; --every run get one node up
|
pos.y = pos.y + 1; --every run get one node up
|
||||||
height = height + 1
|
height = height + 1
|
||||||
local current_node = minetest.get_node(pos); --get the node of the new position
|
local current_node = minetest.get_node(pos); --get the node of the new position
|
||||||
minetest.chat_send_all(string.format("found %q at location: %s",
|
|
||||||
current_node.name,
|
|
||||||
minetest.pos_to_string(pos)
|
|
||||||
))
|
|
||||||
|
|
||||||
if current_node.name == "air" then
|
if current_node.name == "air" then
|
||||||
minetest.set_node(pos, {name = node } )
|
minetest.set_node(pos, {name = node } )
|
||||||
@ -60,7 +52,7 @@ local buildScaffolding = function(node, pos, itemstack, player)
|
|||||||
end
|
end
|
||||||
until current_node.name ~= node or height >= 32 --we repeat until we find something else then "scaffolding:scaffolding"
|
until current_node.name ~= node or height >= 32 --we repeat until we find something else then "scaffolding:scaffolding"
|
||||||
--maybe there should be also another limit, because its currently possible to build infinite towers
|
--maybe there should be also another limit, because its currently possible to build infinite towers
|
||||||
minetest.chat_send_all(string.format("exit loop"))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
print("scaffolding: Loading 'functions.lua'")
|
print("scaffolding: Loading 'functions.lua'")
|
||||||
|
Loading…
Reference in New Issue
Block a user