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

Method AddFunction

CryScriptSystem/ScriptObject.cpp:809–821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

807}*/
808
809bool CScriptObject::AddFunction(const char *sName, SCRIPT_FUNCTION pThunk, int nFuncID)
810{
811 _GUARD_STACK(m_pLS);
812 if (!_GET_THIS())
813 return false;
814
815 lua_pushstring(m_pLS, sName);
816 lua_pushnumber(m_pLS, (lua_Number)nFuncID);
817 //lua_newuserdatabox(m_pLS, m_pThis);
818 lua_pushcclosure(m_pLS, (lua_CFunction)pThunk, 1);
819 SET_FUNCTION(m_pLS, -3);
820 return true;
821}
822
823bool CScriptObject::AddSetGetHandlers(SCRIPT_FUNCTION pSetThunk,SCRIPT_FUNCTION pGetThunk)
824{

Callers 1

RegisterFunctionMethod · 0.80

Calls 3

lua_pushstringFunction · 0.85
lua_pushnumberFunction · 0.85
lua_pushcclosureFunction · 0.85

Tested by

no test coverage detected