Skip to content

Commit c2e3d7c

Browse files
committedJan 15, 2017
Fix most of the namespace pollutions reported in #311
1 parent 7415036 commit c2e3d7c

File tree

8 files changed

+25
-20
lines changed

8 files changed

+25
-20
lines changed
 

‎mesecons_delayer/init.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ elseif i == 2 then delaytime = 0.3
4747
elseif i == 3 then delaytime = 0.5
4848
elseif i == 4 then delaytime = 1.0 end
4949

50-
boxes = {{ -6/16, -8/16, -6/16, 6/16, -7/16, 6/16 }, -- the main slab
50+
local boxes = {
51+
{ -6/16, -8/16, -6/16, 6/16, -7/16, 6/16 }, -- the main slab
5152

5253
{ -2/16, -7/16, -4/16, 2/16, -26/64, -3/16 }, -- the jeweled "on" indicator
5354
{ -3/16, -7/16, -3/16, 3/16, -26/64, -2/16 },
@@ -57,7 +58,8 @@ boxes = {{ -6/16, -8/16, -6/16, 6/16, -7/16, 6/16 }, -- the main slab
5758

5859
{ -6/16, -7/16, -6/16, -4/16, -27/64, -4/16 }, -- the timer indicator
5960
{ -8/16, -8/16, -1/16, -6/16, -7/16, 1/16 }, -- the two wire stubs
60-
{ 6/16, -8/16, -1/16, 8/16, -7/16, 1/16 }}
61+
{ 6/16, -8/16, -1/16, 8/16, -7/16, 1/16 }
62+
}
6163

6264
minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
6365
description = "Delayer",

‎mesecons_extrawires/crossover.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function crossover_get_rules(node)
1+
local function crossover_get_rules(node)
22
return {
33
{--first wire
44
{x=-1,y=0,z=0},

‎mesecons_gates/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ local function update_gate(pos, node, link, newstate)
5454
end
5555
end
5656

57-
function register_gate(name, inputnumber, assess, recipe)
57+
local function register_gate(name, inputnumber, assess, recipe)
5858
local get_inputrules = inputnumber == 2 and gate_get_input_rules_twoinputs or
5959
gate_get_input_rules_oneinput
6060
local description = "Mesecons Logic Gate: "..name

‎mesecons_insulated/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function insulated_wire_get_rules(node)
1+
local function insulated_wire_get_rules(node)
22
local rules = {{x = 1, y = 0, z = 0},
33
{x =-1, y = 0, z = 0}}
44
if node.param2 == 1 or node.param2 == 3 then

‎mesecons_lamp/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
-- A lamp is "is an electrical device used to create artificial light" (wikipedia)
33
-- guess what?
44

5-
mesecon_lamp_box = {
5+
local mesecon_lamp_box = {
66
type = "wallmounted",
77
wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125},
88
wall_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125},

‎mesecons_pistons/init.lua

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,55 @@
11
-- Get mesecon rules of pistons
2-
piston_rules =
3-
{{x=0, y=0, z=1}, --everything apart from z- (pusher side)
2+
local piston_rules = {
3+
{x=0, y=0, z=1}, --everything apart from z- (pusher side)
44
{x=1, y=0, z=0},
55
{x=-1, y=0, z=0},
66
{x=1, y=1, z=0},
77
{x=1, y=-1, z=0},
88
{x=-1, y=1, z=0},
99
{x=-1, y=-1, z=0},
1010
{x=0, y=1, z=1},
11-
{x=0, y=-1, z=1}}
11+
{x=0, y=-1, z=1}
12+
}
1213

13-
local piston_up_rules =
14-
{{x=0, y=0, z=-1}, --everything apart from y+ (pusher side)
14+
local piston_up_rules = {
15+
{x=0, y=0, z=-1}, --everything apart from y+ (pusher side)
1516
{x=1, y=0, z=0},
1617
{x=-1, y=0, z=0},
1718
{x=0, y=0, z=1},
1819
{x=1, y=-1, z=0},
1920
{x=-1, y=-1, z=0},
2021
{x=0, y=-1, z=1},
21-
{x=0, y=-1, z=-1}}
22+
{x=0, y=-1, z=-1}
23+
}
2224

23-
local piston_down_rules =
24-
{{x=0, y=0, z=-1}, --everything apart from y- (pusher side)
25+
local piston_down_rules = {
26+
{x=0, y=0, z=-1}, --everything apart from y- (pusher side)
2527
{x=1, y=0, z=0},
2628
{x=-1, y=0, z=0},
2729
{x=0, y=0, z=1},
2830
{x=1, y=1, z=0},
2931
{x=-1, y=1, z=0},
3032
{x=0, y=1, z=1},
31-
{x=0, y=1, z=-1}}
33+
{x=0, y=1, z=-1}
34+
}
3235

33-
local piston_get_rules = function (node)
36+
local function piston_get_rules(node)
3437
local rules = piston_rules
3538
for i = 1, node.param2 do
3639
rules = mesecon.rotate_rules_left(rules)
3740
end
3841
return rules
3942
end
4043

41-
piston_facedir_direction = function (node)
44+
local function piston_facedir_direction(node)
4245
local rules = {{x = 0, y = 0, z = -1}}
4346
for i = 1, node.param2 do
4447
rules = mesecon.rotate_rules_left(rules)
4548
end
4649
return rules[1]
4750
end
4851

49-
piston_get_direction = function(dir, node)
52+
local function piston_get_direction(dir, node)
5053
if type(dir) == "function" then
5154
return dir(node)
5255
else

‎mesecons_pressureplates/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ local pp_box_on = {
88
fixed = { -7/16, -8/16, -7/16, 7/16, -7.5/16, 7/16 },
99
}
1010

11-
pp_on_timer = function (pos, elapsed)
11+
local function pp_on_timer(pos, elapsed)
1212
local node = minetest.get_node(pos)
1313
local basename = minetest.registered_nodes[node.name].pressureplate_basename
1414

‎mesecons_wires/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ nid_inc = function (nid)
140140
return i <= 8
141141
end
142142

143-
register_wires = function()
143+
local function register_wires()
144144
local nid = {}
145145
while true do
146146
-- Create group specifiction and nodeid string (see note above for details)

1 commit comments

Comments
 (1)

Jeija commented on Jan 15, 2017

@Jeija
Collaborator

Thank you 😌 !

Please sign in to comment.