| 210 | |
| 211 | |
| 212 | bool cLuaState::LoadFile(const AString & a_FileName) |
| 213 | { |
| 214 | ASSERT(IsValid()); |
| 215 | |
| 216 | // Load the file: |
| 217 | int s = luaL_loadfile(m_LuaState, a_FileName.c_str()); |
| 218 | if (ReportErrors(s)) |
| 219 | { |
| 220 | LOGWARNING("Can't load %s because of an error in file %s", m_SubsystemName.c_str(), a_FileName.c_str()); |
| 221 | return false; |
| 222 | } |
| 223 | |
| 224 | // Execute the globals: |
| 225 | s = lua_pcall(m_LuaState, 0, LUA_MULTRET, 0); |
| 226 | if (ReportErrors(s)) |
| 227 | { |
| 228 | LOGWARNING("Error in %s in file %s", m_SubsystemName.c_str(), a_FileName.c_str()); |
| 229 | return false; |
| 230 | } |
| 231 | |
| 232 | return true; |
| 233 | } |
| 234 | |
| 235 | |
| 236 |
no test coverage detected