From 9020948dc514b03e5b8f83f71ec1c3ab92d5eef6 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 19 Jul 2021 00:26:19 +0100 Subject: [PATCH] bit polyfill: fix undeclared global accessed warning --- worldeditadditions/utils/bit.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/worldeditadditions/utils/bit.lua b/worldeditadditions/utils/bit.lua index ca5b33f..05b6341 100644 --- a/worldeditadditions/utils/bit.lua +++ b/worldeditadditions/utils/bit.lua @@ -12,7 +12,13 @@ -- Docs: http://bitop.luajit.org/api.html -- module: bit -local bit = bit or {} + +local bit +if minetest.global_exists("bit") then + bit = bit +else + bit = {} +end bit.bits = 32 bit.powtab = { 1 }