Skip to content

Commit

Permalink
[editor] Fix duplicate map meta entries resulting in editor suspending.
Browse files Browse the repository at this point in the history
  • Loading branch information
chris1384 committed Aug 29, 2024
1 parent 80d98fd commit 84023df
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions [editor]/editor_main/server/resourcehooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ function getResourceFiles ( resource, fileType )
local file = xmlNodeGetAttribute ( node, "src" )
local otherAttributes = xmlNodeGetAttributes ( node )
otherAttributes.src = nil
fileAttributes[file] = otherAttributes
table.insert ( files, file )
if not fileAttributes[file] then
fileAttributes[file] = otherAttributes
table.insert ( files, file )
end
i = i + 1
end
xmlUnloadFile ( meta )
Expand All @@ -118,10 +120,13 @@ function copyResourceFiles ( fromResource, targetResource )
local paths, attr = getResourceFiles(fromResource, fileType)
if paths then
for j,filePath in ipairs(paths) do
fileCopy ( ":" .. getResourceName(fromResource) .. "/" .. filePath, ":" .. getResourceName(targetResource) .. "/" .. filePath, false )
local data = attr[filePath]
data.src = filePath
table.insert ( targetPaths[fileType], data )
local copyPath, copyTarget = ":" .. getResourceName(fromResource) .. "/" .. filePath, ":" .. getResourceName(targetResource) .. "/" .. filePath
if not fileExists(copyTarget) then
fileCopy ( copyPath, copyTarget, false )
local data = attr[filePath]
data.src = filePath
table.insert ( targetPaths[fileType], data )
end
end
else
outputDebugString("copyResourceFiles: getResourceFiles returned "..tostring(paths).." and "..tostring(attr).." for "..tostring(fromResource).." and "..tostring(fileType))
Expand Down

0 comments on commit 84023df

Please sign in to comment.