Skip to content

Commit

Permalink
fix MergeKeyed edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreLouisIssa committed Nov 17, 2022
1 parent d1e9b33 commit 7f97ae5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ModUtil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -959,8 +959,12 @@ end
function ModUtil.Table.MergeKeyed( inTable, setTable )
for setKey, setVal in pairs( setTable ) do
local inVal = inTable[ setKey ]
if type( setVal ) == "table" and type( inVal ) == "table" and not ModUtil.Table.UnKeyed( setVal ) then
ModUtil.Table.MergeKeyed( inVal, setVal )
if type( setVal ) == "table" and type( inVal ) == "table" then
if ModUtil.Table.UnKeyed( setVal ) and ModUtil.Table.UnKeyed( inVal ) then
ModUtil.Table.Replace( inVal, setVal )
else
ModUtil.Table.MergeKeyed( inVal, setVal )
end
else
inTable[ setKey ] = setVal
end
Expand Down

0 comments on commit 7f97ae5

Please sign in to comment.