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

Function Class_CallUFunction

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

* Generic closure to call a UFunction */

Source from the content-addressed store, hash-verified

1502 * Generic closure to call a UFunction
1503 */
1504int32 Class_CallUFunction(lua_State *L)
1505{
1506 //!!!Fix!!!
1507 //delete desc when is not valid
1508 auto& Env = UnLua::FLuaEnv::FindEnvChecked(L);
1509 auto Function = Env.GetObjectRegistry()->Get<FFunctionDesc>(L, lua_upvalueindex(1));
1510 if (!Function->IsValid())
1511 {
1512 UE_LOG(LogUnLua, Log, TEXT("%s: Invalid function descriptor!"), ANSI_TO_TCHAR(__FUNCTION__));
1513 return 0;
1514 }
1515 int32 NumParams = lua_gettop(L);
1516 int32 NumResults = Function->CallUE(L, NumParams);
1517 return NumResults;
1518}
1519
1520/**
1521 * Generic closure to call a latent function

Callers

nothing calls this directly

Calls 3

lua_gettopFunction · 0.85
CallUEMethod · 0.80
IsValidMethod · 0.45

Tested by

no test coverage detected