Fixed loading userlevels

dev-mp
krzys-h 2014-12-25 14:51:52 +01:00
parent 9fda292e01
commit a30202d884
2 changed files with 11 additions and 1 deletions

View File

@ -610,19 +610,25 @@ bool CApplication::Create()
// Create the robot application.
m_controller = new CController(this, !defaultValues);
if(m_runSceneName == "custom")
{
m_controller->GetRobotMain()->ChangePhase(PHASE_USER); // To load userlevel list - TODO: this is ugly
}
if(m_dedicatedServer)
{
m_controller->GetRobotMain()->SetExitAfterMission(true);
m_controller->StartMPServer(m_runSceneName, m_runSceneRank/100, m_runSceneRank%100);
} else {
if(!m_serverAddress.empty())
{
m_controller->GetRobotMain()->SetExitAfterMission(true);
m_controller->StartMPClient(m_serverAddress);
} else {
if(m_runSceneName.empty())
{
m_controller->StartApp();
} else {
m_controller->GetRobotMain()->ChangePhase(PHASE_USER); // To load userlevel list - TODO: this is ugly
m_controller->GetRobotMain()->SetExitAfterMission(true);
m_controller->StartSP(m_runSceneName, m_runSceneRank/100, m_runSceneRank%100);
}

View File

@ -104,6 +104,10 @@ void CClientConnection::PacketLevelData(std::string data)
ar & m_levelData;
// Load the map now
if(m_mapName == "custom")
{
CController::GetInstancePointer()->GetRobotMain()->ChangePhase(PHASE_USER); // To load userlevel list - TODO: this is ugly
}
CController::GetInstancePointer()->GetMainDialog()->SetSceneName(m_mapName.c_str());
CController::GetInstancePointer()->GetMainDialog()->SetSceneRank(m_mapRank);
CController::GetInstancePointer()->GetRobotMain()->ChangePhase(PHASE_LOADING);