mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
fix access to console.__add_command
This commit is contained in:
parent
e7e47df7bf
commit
76be41e8f2
3 changed files with 18 additions and 4 deletions
|
|
@ -167,12 +167,16 @@ function table.remove_value(t, x)
|
|||
end
|
||||
end
|
||||
|
||||
function table.insert_unique(t, val)
|
||||
if table.has(t, val) then
|
||||
function table.insert_unique(t, pos_or_val, val)
|
||||
if table.has(t, val or pos_or_val) then
|
||||
return
|
||||
end
|
||||
|
||||
table.insert(t, val)
|
||||
if val then
|
||||
table.insert(t, pos_or_val, val)
|
||||
else
|
||||
table.insert(t, pos_or_val)
|
||||
end
|
||||
end
|
||||
|
||||
function table.tostring(t)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue