From b04c4610b59966ca76d40da437986ffdb5231e3d Mon Sep 17 00:00:00 2001 From: kay27 Date: Sun, 13 Feb 2022 06:26:34 +0400 Subject: [PATCH] #123 Add fake xor for missing bitop --- mods/CORE/mcl_compatibility/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mods/CORE/mcl_compatibility/init.lua b/mods/CORE/mcl_compatibility/init.lua index 1ca6fc5ef..0cd86f644 100644 --- a/mods/CORE/mcl_compatibility/init.lua +++ b/mods/CORE/mcl_compatibility/init.lua @@ -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)