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

Method LoadScript

CrySystem/ScriptObjectScript.cpp:323–352  ·  view source on GitHub ↗

!load a specified script @param sFileName path of the script that has to be loaded */

Source from the content-addressed store, hash-verified

321 @param sFileName path of the script that has to be loaded
322*/
323int CScriptObjectScript::LoadScript(IFunctionHandler *pH)
324{
325 bool bReload = false;
326 bool bRaiseError = true;
327
328 if (pH->GetParamCount() >= 3)
329 {
330 pH->GetParam(3, bRaiseError);
331 }
332 if (pH->GetParamCount() >= 2)
333 {
334 if (pH->GetParamType(2) == svtNumber)
335 {
336 int iReload;
337
338 if (pH->GetParam(2, iReload))
339 {
340 bReload = (iReload != 0);
341 }
342 }
343 }
344
345 const char *sScriptFile;
346 pH->GetParam(1,sScriptFile);
347
348 if (m_pScriptSystem->ExecuteFile(sScriptFile, bRaiseError, bReload))
349 return pH->EndFunction(1);
350 else
351 return pH->EndFunctionNull();
352}
353
354/*!unload script from the "loaded scripts map" so if this script is loaded again
355 the Script system will reloadit. this function doesn't

Callers

nothing calls this directly

Calls 6

GetParamTypeMethod · 0.80
ExecuteFileMethod · 0.80
EndFunctionMethod · 0.80
EndFunctionNullMethod · 0.80
GetParamCountMethod · 0.45
GetParamMethod · 0.45

Tested by

no test coverage detected