///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
| 937 | ////////////////////////////////////////////////////////////////////// |
| 938 | ////////////////////////////////////////////////////////////////////// |
| 939 | bool 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 | ////////////////////////////////////////////////////////////////////// |
no test coverage detected