BOOL KMissionData::FinishMission(int nType, int nStep, int nLevel) { BOOL bResult = false; BOOL bRetCode = false; KMission* pMission = NULL; KMISSION_DATA_MAP::iterator it; bRetCode = IsMissionOpened(nType, nStep, nLevel); KGLOG_PROCESS_ERROR(bRetCode); pMission = g_pSO3World->m_MissionMgr.GetMission(nType, nStep, nLevel); KGLOG_PROCESS_ERROR(pMission); KGLOG_PROCESS_ERROR(pMission->eType >= emitNewbie && pMission->eType < emitTotal); it = m_Data.find(MAKE_INT32(nType, nStep)); KGLOG_PROCESS_ERROR(it != m_Data.end()); KG_PROCESS_ERROR(it->second.nFinishedLevel < nLevel); it->second.nFinishedLevel = nLevel; g_PlayerServer.DoSyncMissionFinished(m_pPlayer->m_nConnIndex, nType, nStep, nLevel); OpenMission(nType, nStep, nLevel + 1); // 开启下一个难度 if (nType == 2 && nStep == 1 && nLevel == 3) // 热身赛要第三关打完开下一关 OpenMission(nType, nStep + 1, 1); else if (nLevel == 1) // 简单难度则打开下一关 OpenMission(nType, nStep + 1, 1); bResult = true; Exit0: return bResult; }
// // Post // void Post() { // Repaint the interface //IFace::PaintAll(); // Reset FPU Utils::FP::Reset(); // Notify save game of position SaveGame::Notify(0x84191523); // "Load::Game::RC::Load::Pre" // Apply settings from multiplayer setup if (MultiPlayer::Data::HaveData()) { MultiPlayer::SetupPreMission(); } // Load currently selected mission if (!MissionPreLoaded()) { PreOpenMission("interface_game_load.cfg"); } else { Main::Exec("interface_game_load.cfg", Main::ScopeHandler, FALSE); } // Notify save game of position SaveGame::Notify(0xC1280824); // "Load::Game::RC::Load::Post" // Apply settings from multiplayer setup if (MultiPlayer::Data::HaveData()) { MultiPlayer::SetupMission(); } OpenMission(); // Apply post load settings from multiplayer setup if (MultiPlayer::Data::HaveData()) { MultiPlayer::SetupPostMission(); } // Set loaded flag loaded = TRUE; // Setup demo mode if necessary Demo::PostLoad(); // Flush the memory cache //Debug::Memory::FlushCache(); // reset file system for new saved god files FileSys::BuildIndexes(); // Change runcode to the sync RC::Set("SimInit"); }