forked from Mirrorlandia_minetest/mesecons
Make nr in rules rotation local in order not to pullute the holy global namespace
This commit is contained in:
parent
2bbc9dd4b7
commit
7e231b99a6
@ -428,7 +428,7 @@ end
|
|||||||
|
|
||||||
--Rules rotation Functions:
|
--Rules rotation Functions:
|
||||||
function mesecon:rotate_rules_right(rules)
|
function mesecon:rotate_rules_right(rules)
|
||||||
nr = {}
|
local nr = {}
|
||||||
for i, rule in ipairs(rules) do
|
for i, rule in ipairs(rules) do
|
||||||
table.insert(nr, {
|
table.insert(nr, {
|
||||||
x = -rule.z,
|
x = -rule.z,
|
||||||
@ -439,7 +439,7 @@ function mesecon:rotate_rules_right(rules)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function mesecon:rotate_rules_left(rules)
|
function mesecon:rotate_rules_left(rules)
|
||||||
nr = {}
|
local nr = {}
|
||||||
for i, rule in ipairs(rules) do
|
for i, rule in ipairs(rules) do
|
||||||
table.insert(nr, {
|
table.insert(nr, {
|
||||||
x = rule.z,
|
x = rule.z,
|
||||||
@ -450,7 +450,7 @@ function mesecon:rotate_rules_left(rules)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function mesecon:rotate_rules_down(rules)
|
function mesecon:rotate_rules_down(rules)
|
||||||
nr = {}
|
local nr = {}
|
||||||
for i, rule in ipairs(rules) do
|
for i, rule in ipairs(rules) do
|
||||||
table.insert(nr, {
|
table.insert(nr, {
|
||||||
x = -rule.y,
|
x = -rule.y,
|
||||||
@ -461,7 +461,7 @@ function mesecon:rotate_rules_down(rules)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function mesecon:rotate_rules_up(rules)
|
function mesecon:rotate_rules_up(rules)
|
||||||
nr = {}
|
local nr = {}
|
||||||
for i, rule in ipairs(rules) do
|
for i, rule in ipairs(rules) do
|
||||||
table.insert(nr, {
|
table.insert(nr, {
|
||||||
x = rule.y,
|
x = rule.y,
|
||||||
|
Loading…
Reference in New Issue
Block a user