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

Function GetUProperty

Plugins/UnLua/Source/UnLua/Private/UnLuaLib.cpp:95–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93#pragma region Legacy Support
94
95 int32 GetUProperty(lua_State* L)
96 {
97 const auto Ptr = lua_touserdata(L, 2);
98 if (!Ptr)
99 return 0;
100
101 const auto Property = static_cast<TSharedPtr<ITypeOps>*>(Ptr)->Get();
102 if (!Property || !Property->IsValid())
103 return 0;
104
105 const auto Self = GetCppInstance(L, 1);
106 if (!Self)
107 return 0;
108
109 if (LowLevel::IsReleasedPtr(Self))
110 return luaL_error(L, TCHAR_TO_UTF8(*FString::Printf(TEXT("attempt to read property '%s' on released object"), *Property->GetName())));
111
112 if (!LowLevel::CheckPropertyOwner(L, Property, Self))
113 return 0;
114
115 Property->Read(L, Self, false);
116 return 1;
117 }
118
119 int32 SetUProperty(lua_State* L)
120 {

Callers

nothing calls this directly

Calls 9

lua_touserdataFunction · 0.85
GetCppInstanceFunction · 0.85
IsReleasedPtrFunction · 0.85
luaL_errorFunction · 0.85
CheckPropertyOwnerFunction · 0.85
GetMethod · 0.45
IsValidMethod · 0.45
GetNameMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected