Also try this way but this also leave the changesm...
# master
n
Also try this way but this also leave the changesmask on 0 for the nested UF fields:
Copy code
cpp
void GameObject::SetDye(int32 dyeId1, int32 dyeId2, int32 dyeId3)
{
    if (!m_housingDecorData.has_value())
        m_entityFragments.Add(WowCS::EntityFragment::FHousingDecor_C, IsInWorld());

    auto gameObjectGuid = GetGUID();
    auto decorGuid = m_housingDecorData ? m_housingDecorData->DecorGUID : ObjectGuid::Empty;
    if (decorGuid == ObjectGuid::Empty)
        decorGuid = ObjectGuid::Create<HighGuid::Housing>(HousingSubType::Decor, gameObjectGuid.GetRealmId(), 378, 0, gameObjectGuid.GetCounter());

    SetUpdateFieldValue(m_values.ModifyValue(&GameObject::m_housingDecorData, 0).ModifyValue(&UF::HousingDecorData::DecorGUID), decorGuid);
    SetUpdateFieldValue(m_values.ModifyValue(&GameObject::m_housingDecorData, 0).ModifyValue(&UF::HousingDecorData::AttachParentGUID), ObjectGuid::Empty);
    SetUpdateFieldValue(m_values.ModifyValue(&GameObject::m_housingDecorData, 0).ModifyValue(&UF::HousingDecorData::Flags), 0);
    SetUpdateFieldValue(m_values.ModifyValue(&GameObject::m_housingDecorData, 0).ModifyValue(&UF::HousingDecorData::Field_68), ObjectGuid::Empty);

    auto persistedData = m_values.ModifyValue(&GameObject::m_housingDecorData, 0).ModifyValue(&UF::HousingDecorData::PersistedData, 0);
    SetUpdateFieldValue(persistedData.ModifyValue(&UF::DecorStoragePersistedData::HouseGUID), ObjectGuid::Empty);
    SetUpdateFieldValue(persistedData.ModifyValue(&UF::DecorStoragePersistedData::Field_20), 0);

    auto dyeData = persistedData.ModifyValue(&UF::DecorStoragePersistedData::Dyes, 0);
    SetUpdateFieldValue(dyeData.ModifyValue(&UF::DecorStoragePersistedDataDyes::DyeColorID, 0), dyeId1);
    SetUpdateFieldValue(dyeData.ModifyValue(&UF::DecorStoragePersistedDataDyes::DyeColorID, 1), dyeId2);
    SetUpdateFieldValue(dyeData.ModifyValue(&UF::DecorStoragePersistedDataDyes::DyeColorID, 2), dyeId3);
}