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

Method Delegate

CryScriptSystem/ScriptObject.cpp:1463–1480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1461}
1462
1463void CScriptObject::Delegate(IScriptObject *pObj)
1464{
1465 if(!pObj)return;
1466 m_hDelegationTag = lua_newtag(m_pLS);
1467 lua_newuserdatabox(m_pLS, this);
1468 if(!lua_xgetref(m_pLS,pObj->GetRef()))return;
1469 lua_pushcclosure(m_pLS, CScriptObject::IndexTagHandler, 2);
1470 lua_settagmethod(m_pLS, m_hDelegationTag, "index");
1471 if (!_GET_THIS())
1472 {
1473 lua_pushnil(m_pLS);
1474 lua_settagmethod(m_pLS, m_hDelegationTag, "index");
1475 return ;
1476 }
1477
1478 lua_settag(m_pLS, m_hDelegationTag);
1479 lua_pop(m_pLS,1);
1480}

Callers 1

InitMethod · 0.80

Calls 7

lua_newuserdataboxFunction · 0.85
lua_xgetrefFunction · 0.85
lua_pushcclosureFunction · 0.85
lua_settagmethodFunction · 0.85
lua_pushnilFunction · 0.85
lua_settagFunction · 0.85
GetRefMethod · 0.80

Tested by

no test coverage detected