#123 Add fake xor for missing bitop

This commit is contained in:
kay27 2022-02-13 06:26:34 +04:00
parent bf5533799d
commit b04c4610b5
1 changed files with 8 additions and 0 deletions

View File

@ -4,6 +4,14 @@ mcl_vars = mcl_vars or {}
local modname = minetest.get_current_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)
if x >= 0 then
return math.floor(x + 0.5)