mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-25 16:53:46 +01:00
Fix table.difference (fix for cellestial)
This commit is contained in:
parent
d0317cc5d8
commit
0eb59a85bf
14
table.lua
14
table.lua
@ -288,16 +288,18 @@ end
|
|||||||
|
|
||||||
contains = find
|
contains = find
|
||||||
|
|
||||||
function difference(table, other_table)
|
function to_add(table, after_additions)
|
||||||
local result = {}
|
local additions = {}
|
||||||
for key, value in pairs(other_table) do
|
for key, value in pairs(after_additions) do
|
||||||
if table[value] ~= value then
|
if table[key] ~= value then
|
||||||
result[key] = value
|
additions[key] = value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return result
|
return additions
|
||||||
end
|
end
|
||||||
|
|
||||||
|
difference = to_add
|
||||||
|
|
||||||
function add_all(table, additions)
|
function add_all(table, additions)
|
||||||
for key, value in pairs(additions) do
|
for key, value in pairs(additions) do
|
||||||
table[key] = value
|
table[key] = value
|
||||||
|
Loading…
Reference in New Issue
Block a user