| 759 | */ |
| 760 | template <typename... T> |
| 761 | FLuaRetValues FLuaTable::Call(const char* FuncName, T&&... Args) const |
| 762 | { |
| 763 | if (!FuncName) |
| 764 | { |
| 765 | return FLuaRetValues(Env, INDEX_NONE); |
| 766 | } |
| 767 | |
| 768 | lua_State* L = Env->GetMainState(); |
| 769 | lua_pushcfunction(L, ReportLuaCallError); |
| 770 | |
| 771 | lua_pushstring(L, FuncName); |
| 772 | int32 Type = lua_gettable(L, Index); |
| 773 | if (Type != LUA_TFUNCTION) |
| 774 | { |
| 775 | UE_LOG(LogUnLua, Warning, TEXT("Function %s of table doesn't exist!"), UTF8_TO_TCHAR(FuncName)); |
| 776 | lua_pop(L, 2); |
| 777 | return FLuaRetValues(Env, INDEX_NONE); |
| 778 | } |
| 779 | |
| 780 | return CallFunctionInternal(Env, Forward<T>(Args)...); |
| 781 | } |
| 782 | |
| 783 | |
| 784 | /** |
no test coverage detected