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

Method RaiseError

CryScriptSystem/ScriptSystem.cpp:1684–1714  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1682//////////////////////////////////////////////////////////////////////
1683//////////////////////////////////////////////////////////////////////
1684void 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
1716int CScriptSystem::GCTagHandler(lua_State *L)
1717{

Callers 15

FuncThunkMethod · 0.80
LoadSoundMethod · 0.80
Load3DSoundMethod · 0.80
LoadStreamSoundMethod · 0.80
PlaySoundMethod · 0.80
CreateParticleMethod · 0.80
CreateDecalMethod · 0.80
CreateParticleLineMethod · 0.80
ReadParticleTableMethod · 0.80
AttachMethod · 0.80
DetachMethod · 0.80

Calls 3

lua_getstackFunction · 0.85
lua_getinfoFunction · 0.85
OnScriptErrorMethod · 0.80

Tested by

no test coverage detected