Skip to content

Commit

Permalink
feat(itemOrder): sort newly placed objects by timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
MotorcycleEnjoyer committed Feb 29, 2024
1 parent f878f79 commit c45f878
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ext/Server/ProjectManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ function ProjectManager:OnRequestProjectLoad(p_Player, p_ProjectId)
Maps[s_MapName] == nil or
s_GameModeName == nil or
GameModes[s_GameModeName] == nil then

m_Logger:Error("Failed to load project, one or more fields of the project header are not set: " .. s_MapName .. " | " .. s_GameModeName)
return
end
Expand Down Expand Up @@ -316,6 +315,10 @@ function ProjectManager:SaveProjectCoroutine(p_ProjectHeader)
end
end

table.sort(s_GameObjectSaveDatas, function(a, b)
return a.timeStamp < b.timeStamp
end)

-- m_Logger:Write("vvvvvvvvvvvvvvvvv")
-- m_Logger:Write("GameObjectSaveDatas: " .. count)
-- for _, gameObjectSaveData in pairs(s_GameObjectSaveDatas) do
Expand Down

0 comments on commit c45f878

Please sign in to comment.