mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-09-25 13:50:30 +02:00
cleanup
This commit is contained in:
parent
22eae4b805
commit
068da0c047
|
@ -70,8 +70,8 @@ function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky)
|
||||||
local nodes = {}
|
local nodes = {}
|
||||||
local pos_set = {}
|
local pos_set = {}
|
||||||
local frontiers = mesecon.fifo_queue.new()
|
local frontiers = mesecon.fifo_queue.new()
|
||||||
--local vector_equals = vector.equals
|
|
||||||
frontiers:add(vector.new(pos))
|
frontiers:add(vector.new(pos))
|
||||||
|
-- micro-optimization: lift local definitions out of loop
|
||||||
local nodedef
|
local nodedef
|
||||||
local np_hash
|
local np_hash
|
||||||
local nn
|
local nn
|
||||||
|
@ -100,7 +100,7 @@ function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky)
|
||||||
-- If adjacent node is sticky block and connects add that
|
-- If adjacent node is sticky block and connects add that
|
||||||
-- position
|
-- position
|
||||||
for _, r in ipairs(mesecon.rules.alldirs) do
|
for _, r in ipairs(mesecon.rules.alldirs) do
|
||||||
local adjpos = vector.add(np, r)
|
adjpos = vector.add(np, r)
|
||||||
-- optimization: don't check blocks that are already part of the stack
|
-- optimization: don't check blocks that are already part of the stack
|
||||||
if not pos_set[minetest.hash_node_position(adjpos)] then
|
if not pos_set[minetest.hash_node_position(adjpos)] then
|
||||||
adjnode = minetest.get_node(adjpos)
|
adjnode = minetest.get_node(adjpos)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user