* Generic closure to call a UFunction */
| 1502 | * Generic closure to call a UFunction |
| 1503 | */ |
| 1504 | int32 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 |
nothing calls this directly
no test coverage detected