Page 1 of 1

Line 915 of minetest_game\mods\default\nodes.lua not needed

PostPosted: Thu Aug 08, 2013 23:38
by LionsDen
Line 915 of the nodes.lua from the minetest_game mode is a copy of a line a few lines above and as far as I can tell does nothing new. I tested the code in a little mod I made and it doesn't seem to matter if it is there or not. The line is:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local meta0 = meta:to_table()


It is part of the hacky_swap_node function. If it does do something and I'm just not seeing it could someone please tell me what because all I see is a copy of line 910 with no changes to the variables in between.

PostPosted: Fri Aug 09, 2013 12:27
by Casimir
It seems to be there two times.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
function hacky_swap_node(pos,name)
    local node = minetest.get_node(pos)
    local meta = minetest.get_meta(pos)
    local meta0 = meta:to_table() -- here
    if node.name == name then
        return
    end
    node.name = name
    local meta0 = meta:to_table() -- here
    minetest.set_node(pos,node)
    meta = minetest.get_meta(pos)
    meta:from_table(meta0)
end