@@ -189,7 +189,7 @@ function ProjectManager:ParseJSONProject(p_ProjectSaveJSON)
189189 return nil , ' Save header missing necessary field(s)'
190190 end
191191
192- return { [DataBaseManager .m_ExportHeaderName ] = s_Header , [DataBaseManager .m_ExportDataName ] = s_Data }
192+ return { [DataBaseManager .m_ExportHeaderName ] = s_Header , [DataBaseManager .m_ExportDataName ] = s_Data }
193193end
194194
195195--- @param p_Map string
198198function ProjectManager :OnLevelLoaded (p_Map , p_GameMode , p_Round )
199199 m_IsLevelLoaded = true
200200
201- self .m_MapName = p_Map
202- self .m_GameMode = p_GameMode
201+ self .m_MapName = p_Map : gsub ( " .*/ " , " " )
202+ self .m_GameMode = p_GameMode : gsub ( " .*/ " , " " )
203203end
204204
205205function ProjectManager :OnUpdatePass (p_Delta , p_Pass )
@@ -211,8 +211,8 @@ function ProjectManager:OnUpdatePass(p_Delta, p_Pass)
211211 if m_IsLevelLoaded == true and self .m_CurrentProjectHeader ~= nil and self .m_CurrentProjectHeader .id ~= nil and self .m_CurrentProjectHeader .projectName ~= nil then
212212 m_IsLevelLoaded = false
213213
214- if self .m_MapName ~= self .m_CurrentProjectHeader .mapName then
215- m_Logger :Error (" Can't load project that is not built for the same map as current one." )
214+ if self .m_MapName : gsub ( " .*/ " , " " ) ~= self .m_CurrentProjectHeader .mapName : gsub ( " .*/ " , " " ) then
215+ m_Logger :Error (" Can't load project that is not built for the same map as current one. Current: " .. tostring ( self . m_MapName ) .. " , target: " .. tostring ( self . m_CurrentProjectHeader . mapName ) )
216216 return
217217 end
218218
@@ -247,7 +247,7 @@ function ProjectManager:OnRequestProjectLoad(p_Player, p_ProjectId)
247247 local s_Project = DataBaseManager :GetProjectByProjectId (p_ProjectId )
248248
249249 if s_Project == nil then
250- m_Logger :Error (' Failed to get project with id ' .. tostring (p_ProjectId ))
250+ m_Logger :Error (' Failed to get project with id ' .. tostring (p_ProjectId ))
251251 return
252252 end
253253
@@ -257,9 +257,9 @@ function ProjectManager:OnRequestProjectLoad(p_Player, p_ProjectId)
257257 local s_GameModeName = s_Project .header .gameModeName
258258
259259 if s_MapName == nil or
260- Maps [s_MapName ] == nil or
261- s_GameModeName == nil or
262- GameModes [s_GameModeName ] == nil then
260+ Maps [s_MapName ] == nil or
261+ s_GameModeName == nil or
262+ GameModes [s_GameModeName ] == nil then
263263
264264 m_Logger :Error (" Failed to load project, one or more fields of the project header are not set: " .. s_MapName .. " | " .. s_GameModeName )
265265 return
@@ -279,7 +279,7 @@ function ProjectManager:OnRequestProjectLoad(p_Player, p_ProjectId)
279279 return
280280 end
281281
282- s_Response = RCON :SendCommand (' mapList.add' , {s_MapName , s_GameModeName , ' 1' }) -- TODO: add proper map / gameplay support
282+ s_Response = RCON :SendCommand (' mapList.add' , { s_MapName , s_GameModeName , ' 1' }) -- TODO: add proper map / gameplay support
283283 if s_Response [1 ] ~= ' OK' then
284284 m_Logger :Error (' Couldn\' t add map to maplist. ' .. s_Response [1 ])
285285 end
@@ -334,7 +334,6 @@ function ProjectManager:SaveProjectCoroutine(p_ProjectHeader)
334334 end
335335end
336336
337-
338337--- We're creating commands from the savefile, basically imitating every step that has been undertaken
339338--- @param p_ProjectSaveData ProjectDataEntry[]
340339function ProjectManager :CreateAndExecuteImitationCommands (p_ProjectSaveData )
0 commit comments