Fix the common crash, not quite sure why LL doesn't get this one
This fix does a few things: 1. LLMaterialID initializing an LLSD implicitly from a uuid and thus not having it be a Binary, and not overriding LLSD::asBinary, UUIDs are now checked for when receiving an LLSD in constructor 2. Implicitly using a UUID shortcuts to just calling set with the mData.
This commit is contained in:
@@ -42,8 +42,11 @@ LLMaterialID::LLMaterialID()
|
|||||||
|
|
||||||
LLMaterialID::LLMaterialID(const LLSD& pMaterialID)
|
LLMaterialID::LLMaterialID(const LLSD& pMaterialID)
|
||||||
{
|
{
|
||||||
llassert(pMaterialID.isBinary());
|
llassert(pMaterialID.isBinary() || pMaterialID.isUUID());
|
||||||
parseFromBinary(pMaterialID.asBinary());
|
if (pMaterialID.isUUID())
|
||||||
|
set(pMaterialID.asUUID().mData);
|
||||||
|
else
|
||||||
|
parseFromBinary(pMaterialID.asBinary());
|
||||||
}
|
}
|
||||||
|
|
||||||
LLMaterialID::LLMaterialID(const LLSD::Binary& pMaterialID)
|
LLMaterialID::LLMaterialID(const LLSD::Binary& pMaterialID)
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ class LLMaterialID
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LLMaterialID();
|
LLMaterialID();
|
||||||
|
LLMaterialID(const LLUUID& id) { set(id.mData); }
|
||||||
LLMaterialID(const LLSD& pMaterialID);
|
LLMaterialID(const LLSD& pMaterialID);
|
||||||
LLMaterialID(const LLSD::Binary& pMaterialID);
|
LLMaterialID(const LLSD::Binary& pMaterialID);
|
||||||
LLMaterialID(const void* pMemory);
|
LLMaterialID(const void* pMemory);
|
||||||
|
|||||||
Reference in New Issue
Block a user