forked from minetest-mods/mesecons
Compare commits
4 Commits
1963bfcc0d
...
b91fe92d13
Author | SHA1 | Date | |
---|---|---|---|
b91fe92d13 | |||
e15c55c066 | |||
6a87290ead | |||
db5879706d |
@ -16,7 +16,7 @@ mesecon.on_placenode = function(pos, node)
|
||||
-- also call receptor_on if itself is powered already, so that neighboring
|
||||
-- conductors will be activated (when pushing an on-conductor with a piston)
|
||||
for _, s in ipairs(sources) do
|
||||
local rule = vector.subtract(pos, s)
|
||||
local rule = vector.subtract(s, pos)
|
||||
mesecon.turnon(pos, rule)
|
||||
end
|
||||
--mesecon.receptor_on (pos, mesecon.conductor_get_rules(node))
|
||||
|
@ -164,7 +164,9 @@ end
|
||||
|
||||
function mesecon.get_bit(binary,bit)
|
||||
bit = bit or 1
|
||||
local c = binary:len()-(bit-1)
|
||||
local len = binary:len()
|
||||
if bit > len then return false end
|
||||
local c = len-(bit-1)
|
||||
return binary:sub(c,c) == "1"
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user