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

Function SetUProperty

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

Source from the content-addressed store, hash-verified

117 }
118
119 int32 SetUProperty(lua_State* L)
120 {
121 const auto Ptr = lua_touserdata(L, 2);
122 if (!Ptr)
123 return 0;
124
125 const auto Property = static_cast<TSharedPtr<ITypeOps>*>(Ptr)->Get();
126 if (!Property || !Property->IsValid())
127 return 0;
128
129 const auto Self = GetCppInstance(L, 1);
130 if (LowLevel::IsReleasedPtr(Self))
131 return luaL_error(L, TCHAR_TO_UTF8(*FString::Printf(TEXT("attempt to write property '%s' on released object"), *Property->GetName())));
132
133 if (!LowLevel::CheckPropertyOwner(L, Property, Self))
134 return 0;
135
136 Property->Write(L, Self, 3);
137 return 0;
138 }
139
140 static constexpr luaL_Reg UnLua_LegacyFunctions[] = {
141 {"GetUProperty", GetUProperty},

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
WriteMethod · 0.45

Tested by

no test coverage detected