Bugfix for the battery: Use receptor_on/off

This commit is contained in:
Jeija 2012-08-08 20:33:14 +02:00
parent f701dad739
commit 7ed60c75b9

View File

@ -97,6 +97,7 @@ nodenames = {"mesecons_battery:battery_charging_1", "mesecons_battery:battery_ch
batterystate = batterystate + 1
else
node.name=string.gsub(node.name, "charging", "discharging")
mesecon:receptor_on(pos)
end
if string.find(node.name, tostring(math.ceil(batterystate/20))) == nil then
@ -122,6 +123,7 @@ nodenames = {"mesecons_battery:battery_discharging_1", "mesecons_battery:battery
batterystate = batterystate - 1
else
node.name=string.gsub(node.name, "discharging", "charging")
mesecon:receptor_off(pos)
end
if string.find(node.name, tostring(math.ceil(batterystate/20))) == nil then