* __index meta methods for struct */
| 1611 | * __index meta methods for struct |
| 1612 | */ |
| 1613 | int32 ScriptStruct_Index(lua_State *L) |
| 1614 | { |
| 1615 | GetField(L); |
| 1616 | if (lua_type(L, -1) != LUA_TUSERDATA) |
| 1617 | return 1; |
| 1618 | |
| 1619 | const auto Registry = UnLua::FLuaEnv::FindEnvChecked(L).GetObjectRegistry(); |
| 1620 | const auto Property = Registry->Get<UnLua::ITypeOps>(L, -1).Get(); |
| 1621 | if (!Property || !Property->IsValid()) |
| 1622 | return 0; |
| 1623 | |
| 1624 | const auto Self = GetCppInstanceFast(L, 1); |
| 1625 | if (!Self) |
| 1626 | return luaL_error(L, TCHAR_TO_UTF8(*FString::Printf(TEXT("attempt to read property '%s' on released struct"), *Property->GetName()))); |
| 1627 | |
| 1628 | Property->Read(L, Self, false); |
| 1629 | lua_remove(L, -2); |
| 1630 | return 1; |
| 1631 | } |
| 1632 | |
| 1633 | FClassDesc* ScriptStruct_CheckParam(lua_State *L) |
| 1634 | { |
nothing calls this directly
no test coverage detected