| 305 | |
| 306 | |
| 307 | bool LuaHandle::RunCallIn(int ciCode, int inArgs, int outArgs) { |
| 308 | int error; |
| 309 | |
| 310 | error = lua_pcall(L, inArgs, outArgs, 0); |
| 311 | |
| 312 | if (error != 0) { |
| 313 | // log the error |
| 314 | const std::string* ciName = luaCallInDB.GetName(ciCode); |
| 315 | const char* ciNameStr = ciName ? ciName->c_str() : "UNKNOWN"; |
| 316 | LuaLog(0, "%s::RunCallIn: error = %i, %s, %s\n", |
| 317 | GetName().c_str(), error, ciNameStr, lua_tostring(L, -1)); |
| 318 | // move the error string into CALLIN_ERRORS |
| 319 | AddCallInError(L, ciNameStr); |
| 320 | return false; |
| 321 | } |
| 322 | |
| 323 | return true; |
| 324 | } |
| 325 | |
| 326 | |
| 327 | //============================================================================// |