forked from MineClone5/MineClone5
#123 Add fake xor for missing bitop
This commit is contained in:
parent
bf5533799d
commit
b04c4610b5
|
@ -4,6 +4,14 @@ mcl_vars = mcl_vars or {}
|
||||||
local modname = minetest.get_current_modname()
|
local modname = minetest.get_current_modname()
|
||||||
local modpath = minetest.get_modpath(modname)
|
local modpath = minetest.get_modpath(modname)
|
||||||
|
|
||||||
|
if not bit then
|
||||||
|
bit = {}
|
||||||
|
function bit.bxor(a, b)
|
||||||
|
-- fake! mock! speedify for now! TODO: make proper xor bitwise
|
||||||
|
return math.ceil(math.abs(math.floor(a/0.14) * b * 1.001 + b))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function math.round(x)
|
function math.round(x)
|
||||||
if x >= 0 then
|
if x >= 0 then
|
||||||
return math.floor(x + 0.5)
|
return math.floor(x + 0.5)
|
||||||
|
|
Loading…
Reference in New Issue