Falling nodes loses their meta info

vladts
New member
 
Posts: 3
Joined: Tue Jan 31, 2017 23:08

Falling nodes loses their meta info

by vladts » Tue Feb 14, 2017 11:25

Bug is reproducible
Minetest version 0.4.14

How to reproduce:

write mod

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
heavy_cube={}

minetest.register_node("heavy_cube:cube", {
        description = "Heavy cube",
        groups = {cracky = 3, falling_node = 1},
        is_ground_content = false,
        on_construct = function(pos)
                local meta = minetest.get_meta(pos)
                meta:set_float("counter", 0)
        end
})

minetest.register_abm({
        nodenames = {"heavy_cube:cube"},
        interval = 5,
        chance = 1,
        action = function(pos)
                local meta = minetest.get_meta(pos)
                local cnt = meta:get_float("counter")
                minetest.log("action", "Counter: "..cnt)
                cnt = cnt + 1
                meta:set_float("counter", cnt)
        end
})


which gives such log

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
2017-02-14 14:16:10: ACTION[Server]: singleplayer [127.0.0.1] joins game.
2017-02-14 14:16:10: ACTION[Server]: singleplayer joins game. List of players: singleplayer
2017-02-14 14:16:13: ACTION[Server]: Counter: 1
2017-02-14 14:16:14: ACTION[Server]: Counter: 2
2017-02-14 14:16:15: ACTION[Server]: singleplayer punches object 2: LuaEntitySAO at (-0.0727,7.70101,0.8546)
2017-02-14 14:16:19: ACTION[Server]: Counter: 3
2017-02-14 14:16:21: ACTION[Server]: singleplayer digs default:dirt at (0,7,1)
2017-02-14 14:16:21: ACTION[Server]: singleplayer digs default:dirt at (0,7,2)
2017-02-14 14:16:24: ACTION[Server]: Counter: 0


It looks, that minetest simply removes node at the old position an constructs it on the new, without meta info copying
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

Re: Falling nodes loses their meta info

by sfan5 » Tue Feb 14, 2017 12:03

Please report this on Github, nobody of the devs will see it here.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

vladts
New member
 
Posts: 3
Joined: Tue Jan 31, 2017 23:08

Re: Falling nodes loses their meta info

by vladts » Tue Feb 14, 2017 12:32

 


Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 9 guests

cron