mirror of
https://github.com/minetest-mods/MoreMesecons.git
synced 2025-01-06 04:37:33 +01:00
Checking the libs doesnt error
Added pcalls instead of raw requires as suggested by Kikito
This commit is contained in:
parent
e7df9d53cf
commit
57cc66eba6
5
md5.lua
5
md5.lua
@ -35,9 +35,10 @@ local char, byte, format, rep, sub =
|
|||||||
string.char, string.byte, string.format, string.rep, string.sub
|
string.char, string.byte, string.format, string.rep, string.sub
|
||||||
local bit_or, bit_and, bit_not, bit_xor, bit_rshift, bit_lshift
|
local bit_or, bit_and, bit_not, bit_xor, bit_rshift, bit_lshift
|
||||||
|
|
||||||
if require "bit" or require "bit32" then
|
local ok, bit = pcall(require, 'bit')
|
||||||
local bit = require "bit" or require "bit32"
|
if not ok then ok, bit = pcall(require, 'bit32') end
|
||||||
|
|
||||||
|
if ok then
|
||||||
bit_or, bit_and, bit_not, bit_xor = bit.bor, bit.band, bit.bnot, bit.bxor
|
bit_or, bit_and, bit_not, bit_xor = bit.bor, bit.band, bit.bnot, bit.bxor
|
||||||
bit_rshift, bit_lshift = bit.rshift, bit.lshift
|
bit_rshift, bit_lshift = bit.rshift, bit.lshift
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user