aboutsummaryrefslogtreecommitdiff
path: root/debugitems.lua
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2016-05-30 19:58:09 +0200
committerorwell96 <mono96.mml@gmail.com>2016-05-30 19:58:09 +0200
commitd81509c049f8c0a46e9002af7ce4666f4284111b (patch)
treed6fe972604ab07c68420149e082c3a5dc978775f /debugitems.lua
parentc71b0209270daa2df717c449c67507d9db0dc0a9 (diff)
downloadadvtrains-d81509c049f8c0a46e9002af7ce4666f4284111b.tar.gz
advtrains-d81509c049f8c0a46e9002af7ce4666f4284111b.tar.bz2
advtrains-d81509c049f8c0a46e9002af7ce4666f4284111b.zip
fixed even more lua errors and made stable
Diffstat (limited to 'debugitems.lua')
-rw-r--r--debugitems.lua21
1 files changed, 9 insertions, 12 deletions
diff --git a/debugitems.lua b/debugitems.lua
index 89399d2..5cb6630 100644
--- a/debugitems.lua
+++ b/debugitems.lua
@@ -97,9 +97,9 @@ e.g. itemstack:take_item(); return itemstack
^ The default functions handle regular use cases.
]]
})
-minetest.register_tool("advtrains:tttool",
+minetest.register_tool("advtrains:tunnelborer",
{
- description = "traintester tool",
+ description = "tunnelborer",
groups = {cracky=1}, -- key=name, value=rating; rating=1..3.
inventory_image = "drwho_screwdriver.png",
wield_image = "drwho_screwdriver.png",
@@ -113,17 +113,14 @@ minetest.register_tool("advtrains:tttool",
^ Shall place item and return the leftover itemstack
^ default: minetest.item_place ]]
on_use = function(itemstack, user, pointed_thing)
- if pointed_thing.type=="object" then
- local luaent=pointed_thing.ref:get_luaentity()
- if luaent and luaent.is_wagon then
- minetest.chat_send_all("wagon yaw is "..pointed_thing.ref:getyaw())
- minetest.chat_send_all("trains last yaw is set to "..luaent:train().last_front_yaw)
- minetest.chat_send_all("end report")
+ if pointed_thing.type=="node" then
+ for x=-1,1 do
+ for y=-1,1 do
+ for z=-1,1 do
+ minetest.remove_node(vector.add(pointed_thing.under, {x=x, y=y, z=z}))
+ end
+ end
end
- else
- minetest.chat_send_all(dump(minetest.get_node(pointed_thing.under)))
- local c1, c2=advtrains.get_track_connections(minetest.get_node(pointed_thing.under).name, minetest.get_node(pointed_thing.under).param2)
- minetest.chat_send_all(c1.." <-> "..c2)
end
end,
--[[