!Load a level ,start a local client and connect it to the local server, no external connections (sp game) @param sMapName the name of the map to load @param sMissionName the name of the mission[optional] */
| 1150 | @param sMissionName the name of the mission[optional] |
| 1151 | */ |
| 1152 | int CScriptObjectGame::LoadLevel(IFunctionHandler *pH) |
| 1153 | { |
| 1154 | const char *szMapName; |
| 1155 | const char *szMissionName = ""; |
| 1156 | |
| 1157 | if(m_pGame->m_bDedicatedServer) |
| 1158 | return pH->EndFunction(); |
| 1159 | |
| 1160 | pH->GetParam(1,szMapName); |
| 1161 | if(pH->GetParamCount()==2) pH->GetParam(2,szMissionName); |
| 1162 | |
| 1163 | ICVar* pVar = m_pSystem->GetIConsole()->GetCVar("g_GameType"); |
| 1164 | pVar->Set("Default"); |
| 1165 | |
| 1166 | m_pGame->m_tPlayerPersistentData.m_bDataSaved=false; |
| 1167 | m_pGame->LoadLevelCS(false, szMapName, szMissionName, false); |
| 1168 | |
| 1169 | return pH->EndFunction(); |
| 1170 | } |
| 1171 | |
| 1172 | /*!Load a level, start a local client and connect it to the local server, and allow external connections |
| 1173 | @param sMapName the name of the map to load |
nothing calls this directly
no test coverage detected