mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-09-27 23:00:29 +02:00
make code slightly clearer
This commit is contained in:
parent
9d34a1601e
commit
01513d3e4f
|
@ -420,14 +420,16 @@ yc.command_sbi = function(params, eeprom, L, Lv)
|
||||||
|
|
||||||
if status == nil then return nil, nil end
|
if status == nil then return nil, nil end
|
||||||
|
|
||||||
local b = params[1]:byte()
|
if #params[1]==1 then
|
||||||
if #params[1]==1 and 65 <= b and b <= 68 then -- is a port
|
local b = params[1]:byte()
|
||||||
if status == "1" then
|
if 65 <= b and b <= 68 then -- is a port
|
||||||
Lv = yc.set_portstate (params[1], true, Lv)
|
if status == "1" then
|
||||||
else
|
Lv = yc.set_portstate (params[1], true, Lv)
|
||||||
Lv = yc.set_portstate (params[1], false, Lv)
|
else
|
||||||
|
Lv = yc.set_portstate (params[1], false, Lv)
|
||||||
|
end
|
||||||
|
return eeprom, Lv;
|
||||||
end
|
end
|
||||||
return eeprom, Lv;
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--is an eeprom address
|
--is an eeprom address
|
||||||
|
|
Loading…
Reference in New Issue
Block a user