Make nr in rules rotation local in order not to pullute the holy global namespace

This commit is contained in:
Jeija 2012-12-28 07:33:16 +01:00
parent 2bbc9dd4b7
commit 7e231b99a6

View File

@ -428,7 +428,7 @@ end
--Rules rotation Functions:
function mesecon:rotate_rules_right(rules)
nr = {}
local nr = {}
for i, rule in ipairs(rules) do
table.insert(nr, {
x = -rule.z,
@ -439,7 +439,7 @@ function mesecon:rotate_rules_right(rules)
end
function mesecon:rotate_rules_left(rules)
nr = {}
local nr = {}
for i, rule in ipairs(rules) do
table.insert(nr, {
x = rule.z,
@ -450,7 +450,7 @@ function mesecon:rotate_rules_left(rules)
end
function mesecon:rotate_rules_down(rules)
nr = {}
local nr = {}
for i, rule in ipairs(rules) do
table.insert(nr, {
x = -rule.y,
@ -461,7 +461,7 @@ function mesecon:rotate_rules_down(rules)
end
function mesecon:rotate_rules_up(rules)
nr = {}
local nr = {}
for i, rule in ipairs(rules) do
table.insert(nr, {
x = rule.y,