void CEditorGame::ResetClient(IConsoleCmdArgs*) { bool value = s_pEditorGame->m_bPlayer; s_pEditorGame->EnablePlayer(false); IEntityClass *pClass = gEnv->pEntitySystem->GetClassRegistry()->FindClass("Player"); if (pClass) pClass->LoadScript(true); if (value) { s_pEditorGame->ConfigureNetContext(true); SetGameRules(); } s_pEditorGame->EnablePlayer(value); s_pEditorGame->HidePlayer(true); }
//------------------------------------------------------------------------ void CEditorGame::ToggleMultiplayerGameRules() { m_bUsingMultiplayerGameRules = !m_bUsingMultiplayerGameRules; bool value = s_pEditorGame->m_bPlayer; s_pEditorGame->EnablePlayer(false); s_pEditorGame->ConfigureNetContext(true); IEntityClass *pClass = gEnv->pEntitySystem->GetClassRegistry()->FindClass("Player"); if (pClass) { pClass->LoadScript(true); } SetGameRules(); s_pEditorGame->EnablePlayer(value); s_pEditorGame->HidePlayer(true); gEnv->pConsole->ShowConsole(false); }
void CEditorGame::ResetClient(IConsoleCmdArgs*) { g_pGame->ReloadPlayerParamFiles(); bool value = s_pEditorGame->m_bPlayer; s_pEditorGame->EnablePlayer(false); IEntityClass *pClass = gEnv->pEntitySystem->GetClassRegistry()->FindClass("Player"); if (pClass) pClass->LoadScript(true); if (value) { s_pEditorGame->ConfigureNetContext(true); const char *pGameRulesName = GetGameRulesName(); s_pEditorGame->m_pGame->GetIGameFramework()->GetIGameRulesSystem()->CreateGameRules(pGameRulesName); } s_pEditorGame->EnablePlayer(value); s_pEditorGame->HidePlayer(true); }