///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
| 1682 | ////////////////////////////////////////////////////////////////////// |
| 1683 | ////////////////////////////////////////////////////////////////////// |
| 1684 | void CScriptSystem::RaiseError(const char *sErr,...) |
| 1685 | { |
| 1686 | Validate(); |
| 1687 | va_list arglist; |
| 1688 | char sBuf[2048]; |
| 1689 | lua_Debug ar; |
| 1690 | int nRes; |
| 1691 | int iCurrentLine=-1; // no line number info |
| 1692 | const char *sFuncName = NULL; |
| 1693 | const char *sSourceFile = NULL; |
| 1694 | |
| 1695 | va_start(arglist, sErr); |
| 1696 | vsprintf(sBuf, sErr, arglist); |
| 1697 | va_end(arglist); |
| 1698 | |
| 1699 | nRes = lua_getstack(m_pLS, 1, &ar); |
| 1700 | if (nRes != 0) |
| 1701 | { |
| 1702 | nRes = lua_getinfo(m_pLS, "lnS", &ar); |
| 1703 | iCurrentLine=ar.currentline; |
| 1704 | sFuncName = ar.name; |
| 1705 | sSourceFile = ar.source; |
| 1706 | } |
| 1707 | if (!sFuncName) |
| 1708 | sFuncName = "undefined"; |
| 1709 | if (!sSourceFile) |
| 1710 | sSourceFile= "undefined"; |
| 1711 | |
| 1712 | if (sBuf) |
| 1713 | m_pSink->OnScriptError(sSourceFile, sFuncName, iCurrentLine, sBuf); |
| 1714 | } |
| 1715 | |
| 1716 | int CScriptSystem::GCTagHandler(lua_State *L) |
| 1717 | { |
no test coverage detected