MCPcopy Create free account
hub / github.com/Tencent/UnLua / CallFunction

Function CallFunction

Plugins/UnLua/Source/UnLua/Private/LuaCore.cpp:954–966  ·  view source on GitHub ↗

* Call a Lua function */

Source from the content-addressed store, hash-verified

952 * Call a Lua function
953 */
954bool CallFunction(lua_State *L, int32 NumArgs, int32 NumResults)
955{
956 int32 ErrorReporterIdx = lua_gettop(L) - NumArgs - 1;
957 int32 Code = lua_pcall(L, NumArgs, NumResults, -(NumArgs + 2));
958 if (Code == LUA_OK)
959 {
960 lua_remove(L, ErrorReporterIdx);
961 return true;
962 }
963 int32 TopIdx = lua_gettop(L);
964 lua_pop(L, TopIdx - ErrorReporterIdx + 1);
965 return false;
966}
967
968/**
969 * Push a field (property or function)

Callers 1

BindMethod · 0.85

Calls 1

lua_gettopFunction · 0.85

Tested by

no test coverage detected