mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-09-25 13:50:30 +02:00
don't check for sticky blocks in locations that are already being pushed
This commit is contained in:
parent
00359e7ae8
commit
ba9b2509a0
|
@ -95,6 +95,8 @@ function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky)
|
||||||
-- position
|
-- position
|
||||||
for _, r in ipairs(mesecon.rules.alldirs) do
|
for _, r in ipairs(mesecon.rules.alldirs) do
|
||||||
local adjpos = vector.add(np, r)
|
local adjpos = vector.add(np, r)
|
||||||
|
-- optimization: don't check blocks that are already part of the stack
|
||||||
|
if not pos_set[minetest.hash_node_position(adjpos)] then
|
||||||
local adjnode = minetest.get_node(adjpos)
|
local adjnode = minetest.get_node(adjpos)
|
||||||
if minetest.registered_nodes[adjnode.name]
|
if minetest.registered_nodes[adjnode.name]
|
||||||
and minetest.registered_nodes[adjnode.name].mvps_sticky then
|
and minetest.registered_nodes[adjnode.name].mvps_sticky then
|
||||||
|
@ -109,6 +111,7 @@ function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if all_pull_sticky then
|
if all_pull_sticky then
|
||||||
frontiers:add(vector.subtract(np, dir))
|
frontiers:add(vector.subtract(np, dir))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user