Backport #868 to 7.4 (custom pivot geter/setter) (#869)

This PR backports some changes to rbx_dom_lua to fix serving model
pivots
This commit is contained in:
Kenneth Loeffler
2024-02-20 12:22:27 -08:00
committed by GitHub
parent f716928683
commit 88efbd433f
5 changed files with 518 additions and 97 deletions

View File

@@ -493,9 +493,32 @@ types = {
},
}
types.OptionalCFrame = {
fromPod = function(pod)
if pod == nil then
return nil
else
return types.CFrame.fromPod(pod)
end
end,
toPod = function(roblox)
if roblox == nil then
return nil
else
return types.CFrame.toPod(roblox)
end
end,
}
function EncodedValue.decode(encodedValue)
local ty, value = next(encodedValue)
if ty == nil then
-- If the encoded pair is empty, assume it is an unoccupied optional value
return true, nil
end
local typeImpl = types[ty]
if typeImpl == nil then
return false, "Couldn't decode value " .. tostring(ty)