mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-11-06 02:10:20 +01:00
Put node in test move info
This commit is contained in:
parent
f2eded427f
commit
7680b31663
|
@ -33,8 +33,8 @@ mesecon._test_moves = {}
|
|||
minetest.register_node("mesecons_mvps:test_on_move", {
|
||||
description = "Test Moveable",
|
||||
mesecon = {
|
||||
on_mvps_move = function(pos, _, oldpos, meta)
|
||||
table.insert(mesecon._test_moves, {pos, oldpos, meta})
|
||||
on_mvps_move = function(pos, node, oldpos, meta)
|
||||
table.insert(mesecon._test_moves, {pos, node, oldpos, meta})
|
||||
end
|
||||
},
|
||||
})
|
||||
|
|
|
@ -122,9 +122,9 @@ describe("node movement", function()
|
|||
it("calls move callbacks", function()
|
||||
local pos = {x = 0, y = 0, z = 0}
|
||||
local dir = {x = 1, y = 0, z = 0}
|
||||
world.set_node(pos, "mesecons_mvps:test_on_move")
|
||||
world.set_node(pos, {name = "mesecons_mvps:test_on_move", param2 = 123})
|
||||
minetest.get_meta(pos):set_string("foo", "bar")
|
||||
local move_info = {vector.add(pos, dir), pos, minetest.get_meta(pos):to_table()}
|
||||
local move_info = {vector.add(pos, dir), world.get_node(pos), pos, minetest.get_meta(pos):to_table()}
|
||||
|
||||
mesecon.mvps_push(pos, dir, 1, "")
|
||||
assert.equal(1, #mesecon._test_moves)
|
||||
|
|
Loading…
Reference in New Issue
Block a user