Fix for LoadLevel not being called. (#584)

This commit is contained in:
bosnichd
2021-05-05 13:35:50 -06:00
committed by GitHub
parent 7ba3a19b40
commit 5783bf635b
4 changed files with 7 additions and 15 deletions
+1 -1
View File
@@ -3200,7 +3200,7 @@ CCryEditApp::ECreateLevelResult CCryEditApp::CreateLevel(const QString& levelNam
m_bIsExportingLegacyData = false;
}
GetIEditor()->GetGameEngine()->LoadLevel(GetIEditor()->GetGameEngine()->GetMissionName(), true, true);
GetIEditor()->GetGameEngine()->LoadLevel(true, true);
GetIEditor()->GetSystem()->GetISystemEventDispatcher()->OnSystemEvent(ESYSTEM_EVENT_LEVEL_PRECACHE_START, 0, 0);
GetIEditor()->GetSystem()->GetISystemEventDispatcher()->OnSystemEvent(ESYSTEM_EVENT_LEVEL_PRECACHE_END, 0, 0);
+5
View File
@@ -459,6 +459,11 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename)
Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::PushRequestBlocking, oAudioRequestData);
}
{
CAutoLogTime logtime("Game Engine level load");
GetIEditor()->GetGameEngine()->LoadLevel(true, true);
}
if (!isPrefabEnabled)
{
//////////////////////////////////////////////////////////////////////////
+1 -8
View File
@@ -539,19 +539,12 @@ void CGameEngine::SetLevelPath(const QString& path)
}
}
void CGameEngine::SetMissionName(const QString& mission)
{
m_missionName = mission;
}
bool CGameEngine::LoadLevel(
const QString& mission,
[[maybe_unused]] bool bDeleteAIGraph,
bool bReleaseResources)
{
LOADING_TIME_PROFILE_SECTION(GetIEditor()->GetSystem());
m_bLevelLoaded = false;
m_missionName = mission;
CLogFile::FormatLine("Loading map '%s' into engine...", m_levelPath.toUtf8().data());
// Switch the current directory back to the Primary CD folder first.
// The engine might have trouble to find some files when the current
@@ -600,7 +593,7 @@ bool CGameEngine::LoadLevel(
bool CGameEngine::ReloadLevel()
{
if (!LoadLevel(GetMissionName(), false, false))
if (!LoadLevel(false, false))
{
return false;
}
-6
View File
@@ -89,7 +89,6 @@ public:
//! Load new terrain level into 3d engine.
//! Also load AI triangulation for this level.
bool LoadLevel(
const QString& mission,
bool bDeleteAIGraph,
bool bReleaseResources);
//!* Reload level if it was already loaded.
@@ -107,14 +106,10 @@ public:
bool IsLevelLoaded() const { return m_bLevelLoaded; };
//! Assign new level path name.
void SetLevelPath(const QString& path);
//! Assign new current mission name.
void SetMissionName(const QString& mission);
//! Return name of currently loaded level.
const QString& GetLevelName() const { return m_levelName; };
//! Return extension of currently loaded level.
const QString& GetLevelExtension() const { return m_levelExtension; };
//! Return name of currently active mission.
const QString& GetMissionName() const { return m_missionName; };
//! Get fully specified level path.
const QString& GetLevelPath() const { return m_levelPath; };
//! Query if engine is in game mode.
@@ -172,7 +167,6 @@ private:
CLogFile m_logFile;
QString m_levelName;
QString m_levelExtension;
QString m_missionName;
QString m_levelPath;
QString m_MOD;
bool m_bLevelLoaded;