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

Method ExecuteFile

CryScriptSystem/ScriptSystem.cpp:939–967  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

937//////////////////////////////////////////////////////////////////////
938//////////////////////////////////////////////////////////////////////
939bool CScriptSystem::ExecuteFile(const char *sFileName, bool bRaiseError,bool bForceReload)
940{
941 if (strlen(sFileName) <= 0)
942 return false;
943 string sTemp;
944 sTemp = FormatPath(sFileName);
945 //ScriptFileListItor itor = std::find(m_dqLoadedFiles.begin(), m_dqLoadedFiles.end(), sTemp.c_str());
946 ScriptFileListItor itor = m_dqLoadedFiles.find(sTemp);
947 if (itor == m_dqLoadedFiles.end() || bForceReload)
948 {
949 if (!_ExecuteFile(sTemp.c_str(), bRaiseError))
950 {
951#if defined(_DEBUG) && (defined(WIN64) || defined(LINUX64))
952 char szBuf[0x800];
953 _snprintf (szBuf, sizeof(szBuf), "Can't execute script %s : %s\n", sFileName, sTemp.c_str());
954 OutputDebugString (szBuf);
955#endif
956 return false;
957 }
958 if(itor == m_dqLoadedFiles.end())
959 m_dqLoadedFiles.insert(sTemp);
960 }
961#if defined(_DEBUG) && (defined(WIN64) || defined(LINUX64))
962 char szBuf[0x800];
963 _snprintf (szBuf, sizeof(szBuf), "Script %s executed\n", sFileName);
964 OutputDebugString (szBuf);
965#endif
966 return true;
967}
968
969//////////////////////////////////////////////////////////////////////
970//////////////////////////////////////////////////////////////////////

Callers 15

LoadMusicDataFromLUAMethod · 0.80
EAXPresetMgr.cppFile · 0.80
LoadMethod · 0.80
InitGameMethod · 0.80
LoadMethod · 0.80
ReloadScriptsMethod · 0.80
LoadFromLuaMethod · 0.80
CreateGameMethod · 0.80
ReloadScriptMethod · 0.80
LoadScriptMethod · 0.80
LoadRandomExpressionsMethod · 0.80
LoadRegistryEntryMethod · 0.80

Calls 4

findMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected