Minetest: Boxes: pairs -> ipairs

Proposed by Gregor Parzefall in 1d2b103abe
This commit is contained in:
Lars Mueller 2022-10-29 17:21:09 +02:00
parent 2eaaca5de4
commit 26d9b131a5

@ -1,6 +1,6 @@
-- Localize globals
local assert, ipairs, math, minetest, pairs, table, type, vector
= assert, ipairs, math, minetest, pairs, table, type, vector
local assert, ipairs, math, minetest, table, type, vector
= assert, ipairs, math, minetest, table, type, vector
-- Set environment
local _ENV = ...
@ -48,7 +48,7 @@ local function get_node_boxes(pos, type)
if box_type == "leveled" then
boxes = table.copy(boxes)
local level = (paramtype2 == "leveled" and node.param2 or node_def.leveled or 0) / 255 - 0.5
for _, box in pairs(boxes) do
for _, box in ipairs(boxes) do
box[5] = level
end
elseif box_type == "wallmounted" then
@ -92,7 +92,7 @@ local function get_node_boxes(pos, type)
matchers[i] = nodename_matcher(nodename_or_group)
end
local function connects_to(nodename)
for _, matcher in pairs(matchers) do
for _, matcher in ipairs(matchers) do
if matcher(nodename) then
return true
end
@ -130,7 +130,7 @@ local function get_node_boxes(pos, type)
if axis == 2 then
sin = -sin
end
for _, box in pairs(boxes) do
for _, box in ipairs(boxes) do
for off = 0, 3, 3 do
local axis_1, axis_2 = other_axis_1 + off, other_axis_2 + off
local value_1, value_2 = box[axis_1], box[axis_2]