mirror of
https://github.com/edubart/otclient.git
synced 2025-04-30 09:39:21 +02:00

* Can now filter market items by vocation, level, slot type, and depot items. * Added new bitwise lib for handling flag operations. * Can now get/set local player vocation/premium (TODO: spell list).
17 lines
258 B
Lua
17 lines
258 B
Lua
Bit = {}
|
|
|
|
function Bit.bit(p)
|
|
return 2 ^ p
|
|
end
|
|
|
|
function Bit.hasBit(x, p)
|
|
return x % (p + p) >= p
|
|
end
|
|
|
|
function Bit.setbit(x, p)
|
|
return Bit.hasBit(x, p) and x or x + p
|
|
end
|
|
|
|
function Bit.clearbit(x, p)
|
|
return Bit.hasBit(x, p) and x - p or x
|
|
end |