Remove inconsistent swap_node_force usage
This commit is contained in:
parent
683aa83f5a
commit
42d9e8f0ae
|
@ -21,7 +21,7 @@ describe("action queue", function()
|
|||
end)
|
||||
|
||||
it("executes in order", function()
|
||||
mesecon.swap_node_force(layout[1][1], "mesecons:test_receptor_on")
|
||||
world.set_node(layout[1][1], "mesecons:test_receptor_on")
|
||||
mesecon.receptor_on(layout[1][1], mesecon.rules.alldirs)
|
||||
mineunit:execute_globalstep()
|
||||
mineunit:execute_globalstep()
|
||||
|
@ -29,7 +29,7 @@ describe("action queue", function()
|
|||
assert.same({"on", layout[4][1]}, mesecon._test_effector_events[1])
|
||||
assert.same({"on", layout[5][1]}, mesecon._test_effector_events[2])
|
||||
|
||||
mesecon.swap_node_force(layout[1][1], "mesecons:test_receptor_off")
|
||||
world.set_node(layout[1][1], "mesecons:test_receptor_off")
|
||||
mesecon.receptor_off(layout[1][1], mesecon.rules.alldirs)
|
||||
mineunit:execute_globalstep()
|
||||
mineunit:execute_globalstep()
|
||||
|
@ -39,9 +39,9 @@ describe("action queue", function()
|
|||
end)
|
||||
|
||||
it("ignores overwritten actions", function()
|
||||
mesecon.swap_node_force(layout[1][1], "mesecons:test_receptor_on")
|
||||
world.set_node(layout[1][1], "mesecons:test_receptor_on")
|
||||
mesecon.receptor_on(layout[1][1], mesecon.rules.alldirs)
|
||||
mesecon.swap_node_force(layout[1][1], "mesecons:test_receptor_off")
|
||||
world.set_node(layout[1][1], "mesecons:test_receptor_off")
|
||||
mesecon.receptor_off(layout[1][1], mesecon.rules.alldirs)
|
||||
mineunit:execute_globalstep()
|
||||
mineunit:execute_globalstep()
|
||||
|
@ -49,7 +49,7 @@ describe("action queue", function()
|
|||
end)
|
||||
|
||||
it("delays actions", function()
|
||||
mesecon.swap_node_force(layout[1][1], "mesecons:test_receptor_on")
|
||||
world.set_node(layout[1][1], "mesecons:test_receptor_on")
|
||||
mesecon.queue:add_action(layout[1][1], "receptor_on", {mesecon.rules.alldirs}, 1, nil)
|
||||
mineunit:execute_globalstep(0.1)
|
||||
mineunit:execute_globalstep(1)
|
||||
|
|
|
@ -22,7 +22,7 @@ describe("state", function()
|
|||
end)
|
||||
|
||||
it("turns on", function()
|
||||
mesecon.swap_node_force(layout[1][1], "mesecons:test_receptor_on")
|
||||
world.set_node(layout[1][1], "mesecons:test_receptor_on")
|
||||
mesecon.receptor_on(layout[1][1], mesecon.rules.alldirs)
|
||||
mineunit:execute_globalstep()
|
||||
mineunit:execute_globalstep()
|
||||
|
@ -31,7 +31,7 @@ describe("state", function()
|
|||
assert.equal(tonumber("10000010", 2), world.get_node(layout[5][1]).param2)
|
||||
assert.equal(tonumber("10000100", 2), world.get_node(layout[6][1]).param2)
|
||||
|
||||
mesecon.swap_node_force(layout[2][1], "mesecons:test_receptor_on")
|
||||
world.set_node(layout[2][1], "mesecons:test_receptor_on")
|
||||
mesecon.receptor_on(layout[2][1], mesecon.rules.alldirs)
|
||||
mineunit:execute_globalstep()
|
||||
mineunit:execute_globalstep()
|
||||
|
@ -42,13 +42,13 @@ describe("state", function()
|
|||
end)
|
||||
|
||||
it("turns off", function()
|
||||
mesecon.swap_node_force(layout[1][1], "mesecons:test_receptor_on")
|
||||
mesecon.swap_node_force(layout[2][1], "mesecons:test_receptor_on")
|
||||
world.set_node(layout[1][1], "mesecons:test_receptor_on")
|
||||
world.set_node(layout[2][1], "mesecons:test_receptor_on")
|
||||
mesecon.receptor_on(layout[1][1], mesecon.rules.alldirs)
|
||||
mesecon.receptor_on(layout[2][1], mesecon.rules.alldirs)
|
||||
mineunit:execute_globalstep()
|
||||
|
||||
mesecon.swap_node_force(layout[1][1], "mesecons:test_receptor_off")
|
||||
world.set_node(layout[1][1], "mesecons:test_receptor_off")
|
||||
mesecon.receptor_off(layout[1][1], mesecon.rules.alldirs)
|
||||
mineunit:execute_globalstep()
|
||||
mineunit:execute_globalstep()
|
||||
|
@ -57,7 +57,7 @@ describe("state", function()
|
|||
assert.equal(tonumber("00000000", 2), world.get_node(layout[5][1]).param2)
|
||||
assert.equal(tonumber("10000100", 2), world.get_node(layout[6][1]).param2)
|
||||
|
||||
mesecon.swap_node_force(layout[2][1], "mesecons:test_receptor_off")
|
||||
world.set_node(layout[2][1], "mesecons:test_receptor_off")
|
||||
mesecon.receptor_off(layout[2][1], mesecon.rules.alldirs)
|
||||
mineunit:execute_globalstep()
|
||||
mineunit:execute_globalstep()
|
||||
|
@ -89,7 +89,7 @@ describe("rotation", function()
|
|||
end)
|
||||
|
||||
it("works", function()
|
||||
mesecon.swap_node_force(layout[1][1], "mesecons:test_receptor_on")
|
||||
world.set_node(layout[1][1], "mesecons:test_receptor_on")
|
||||
mesecon.receptor_on(layout[1][1], mesecon.rules.alldirs)
|
||||
mineunit:execute_globalstep()
|
||||
assert.equal("mesecons:test_conductor_rot_on", world.get_node(layout[2][1]).name)
|
||||
|
@ -117,17 +117,17 @@ describe("multiconductor", function()
|
|||
end)
|
||||
|
||||
it("separates its subparts", function()
|
||||
mesecon.swap_node_force(layout[1][1], "mesecons:test_receptor_on")
|
||||
world.set_node(layout[1][1], "mesecons:test_receptor_on")
|
||||
mesecon.receptor_on(layout[1][1], mesecon.rules.alldirs)
|
||||
mineunit:execute_globalstep()
|
||||
assert.equal("mesecons:test_multiconductor_001", world.get_node(layout[4][1]).name)
|
||||
|
||||
mesecon.swap_node_force(layout[2][1], "mesecons:test_receptor_on")
|
||||
world.set_node(layout[2][1], "mesecons:test_receptor_on")
|
||||
mesecon.receptor_on(layout[2][1], mesecon.rules.alldirs)
|
||||
mineunit:execute_globalstep()
|
||||
assert.equal("mesecons:test_multiconductor_011", world.get_node(layout[4][1]).name)
|
||||
|
||||
mesecon.swap_node_force(layout[3][1], "mesecons:test_receptor_on")
|
||||
world.set_node(layout[3][1], "mesecons:test_receptor_on")
|
||||
mesecon.receptor_on(layout[3][1], mesecon.rules.alldirs)
|
||||
mineunit:execute_globalstep()
|
||||
assert.equal("mesecons:test_multiconductor_on", world.get_node(layout[4][1]).name)
|
||||
|
@ -139,7 +139,7 @@ describe("multiconductor", function()
|
|||
world.set_node({x = -1, y = -1, z = 0}, "mesecons:test_conductor_off")
|
||||
world.set_node({x = -1, y = 0, z = 0}, "mesecons:test_conductor_off")
|
||||
|
||||
mesecon.swap_node_force(layout[1][1], "mesecons:test_receptor_on")
|
||||
world.set_node(layout[1][1], "mesecons:test_receptor_on")
|
||||
mesecon.receptor_on(layout[1][1], mesecon.rules.alldirs)
|
||||
mineunit:execute_globalstep()
|
||||
assert.equal("mesecons:test_multiconductor_101", world.get_node(layout[4][1]).name)
|
||||
|
|
Loading…
Reference in New Issue