forked from minetest-mods/mesecons
Compare commits
2 Commits
6a87290ead
...
b91fe92d13
Author | SHA1 | Date | |
---|---|---|---|
b91fe92d13 | |||
e15c55c066 |
@ -164,7 +164,9 @@ end
|
|||||||
|
|
||||||
function mesecon.get_bit(binary,bit)
|
function mesecon.get_bit(binary,bit)
|
||||||
bit = bit or 1
|
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"
|
return binary:sub(c,c) == "1"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user