mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
Merge branch 'main' into headless-mode
This commit is contained in:
commit
1149d5869c
5 changed files with 59 additions and 33 deletions
|
|
@ -72,9 +72,14 @@ function data_buffer:put_byte(byte)
|
|||
end
|
||||
|
||||
function data_buffer:put_bytes(bytes)
|
||||
for i = 1, #bytes do
|
||||
self:put_byte(bytes[i])
|
||||
end
|
||||
if type(self.bytes) == 'table' then
|
||||
for i = 1, #bytes do
|
||||
self:put_byte(bytes[i])
|
||||
end
|
||||
else
|
||||
self.bytes:insert(self.pos, bytes)
|
||||
self.pos = self.pos + #bytes
|
||||
end
|
||||
end
|
||||
|
||||
function data_buffer:put_single(single)
|
||||
|
|
@ -308,4 +313,4 @@ end
|
|||
|
||||
setmetatable(data_buffer, data_buffer)
|
||||
|
||||
return data_buffer
|
||||
return data_buffer
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
-- Check if given table is an array
|
||||
function is_array(x)
|
||||
if #t > 0 then
|
||||
if #x > 0 then
|
||||
return true
|
||||
end
|
||||
for k, v in pairs(x) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue