| 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}, |
nothing calls this directly
no test coverage detected