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

Method GetFunctionPtr

CryScriptSystem/ScriptSystem.cpp:1241–1254  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1239//////////////////////////////////////////////////////////////////////
1240//////////////////////////////////////////////////////////////////////
1241HSCRIPTFUNCTION CScriptSystem::GetFunctionPtr(const char *sFuncName)
1242{
1243 _GUARD_STACK(m_pLS);
1244 HSCRIPTFUNCTION func;
1245 lua_getglobal(m_pLS, sFuncName);
1246 if (lua_isnil(m_pLS, -1) ||(!lua_isfunction(m_pLS, -1)))
1247 {
1248 lua_pop(m_pLS, 1);
1249 return NULL;
1250 }
1251 func = (HSCRIPTFUNCTION)lua_ref(m_pLS, 0);
1252
1253 return func;
1254}
1255
1256//////////////////////////////////////////////////////////////////////
1257//////////////////////////////////////////////////////////////////////

Callers 11

SetCommonCallbacksMethod · 0.80
GetScriptFunctionPtrsMethod · 0.80
GetGameTypeMethod · 0.80
ProcessPMessagesMethod · 0.80
OnErrorMethod · 0.80
OnFinishedMethod · 0.80
ConnectMethod · 0.80
OnXContextSetupMethod · 0.80
OnServerMsgTextMethod · 0.80

Calls 5

lua_getglobalFunction · 0.85
lua_refFunction · 0.85
lua_pushstringFunction · 0.85
lua_gettableFunction · 0.85
lua_removeFunction · 0.85

Tested by

no test coverage detected