MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / LoadLevel

Method LoadLevel

CryGame/ScriptObjectGame.cpp:1152–1170  ·  view source on GitHub ↗

!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] */

Source from the content-addressed store, hash-verified

1150 @param sMissionName the name of the mission[optional]
1151*/
1152int 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

Callers

nothing calls this directly

Calls 7

EndFunctionMethod · 0.80
GetCVarMethod · 0.80
GetIConsoleMethod · 0.80
LoadLevelCSMethod · 0.80
GetParamMethod · 0.45
GetParamCountMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected