From 8fa68949531430456cece238ca585dfd235ca76e Mon Sep 17 00:00:00 2001
From: Jeija <norrepli@gmail.com>
Date: Fri, 10 Aug 2012 18:58:21 +0200
Subject: [PATCH] Consistency improvement and remove dead code

---
 mesecons/init.lua         | 27 +++++++++++----------------
 mesecons/internal_api.lua | 10 ----------
 2 files changed, 11 insertions(+), 26 deletions(-)

diff --git a/mesecons/init.lua b/mesecons/init.lua
index b67e88a..7142e8a 100644
--- a/mesecons/init.lua
+++ b/mesecons/init.lua
@@ -138,8 +138,6 @@ minetest.register_craft({
 	}
 })
 
-mesecon:register_conductor("mesecons:mesecon_on", "mesecons:mesecon_off")
-
 -- API API API API API API API API API API API API API API API API API API
 
 function mesecon:add_receptor_node(nodename, rules, get_rules) --rules table is optional; if rules depend on param2 pass (nodename, nil, function get_rules)
@@ -207,6 +205,16 @@ function mesecon:register_on_signal_change(action)
 	mesecon.actions_change[i]=action
 end
 
+function mesecon:register_conductor (onstate, offstate)
+	local i=0
+	while mesecon.conductors[i]~=nil do
+		i=i+1
+	end
+	mesecon.conductors[i]={}
+	mesecon.conductors[i].on=onstate
+	mesecon.conductors[i].off=offstate
+end
+
 mesecon:add_rules("default", 
 {{x=0,  y=0,  z=-1},
 {x=1,  y=0,  z=0},
@@ -223,17 +231,4 @@ mesecon:add_rules("default",
 
 print("[MESEcons] Main mod Loaded!")
 
---minetest.register_on_newplayer(function(player)
-	--local i=1
-	--while mesecon.wireless_receivers[i]~=nil do
-	--	pos=mesecon.wireless_receivers[i].pos
-	--	request=mesecon.wireless_receivers[i].requested_state
-	--	inverting=mesecon.wireless_receivers[i].inverting
-	--	if request==inverting then
-	--		mesecon:receptor_off(pos)
-	--	end
-	--	if request~=inverting  then
-	--		mesecon:receptor_on(pos)
-	--	end
-	--end
---end)
+mesecon:register_conductor("mesecons:mesecon_on", "mesecons:mesecon_off")
diff --git a/mesecons/internal_api.lua b/mesecons/internal_api.lua
index ef0c3df..f2b097a 100644
--- a/mesecons/internal_api.lua
+++ b/mesecons/internal_api.lua
@@ -117,16 +117,6 @@ end
 
 --Conductor system stuff
 
-function mesecon:register_conductor(onstate, offstate)
-	local i=0
-	while mesecon.conductors[i]~=nil do
-		i=i+1
-	end
-	mesecon.conductors[i]={}
-	mesecon.conductors[i].on=onstate
-	mesecon.conductors[i].off=offstate
-end
-
 function mesecon:get_conductor_on(offstate)
 	local i=0
 	while mesecon.conductors[i]~=nil do