From b3384a057d9556b2429a9c5847e8e1240103585a Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Thu, 9 Nov 2023 00:39:34 +0200
Subject: [PATCH] SL-20228 When a reflection probe is unchecked in a link set,
 it should stop being phantom

---
 indra/newview/llpanelvolume.cpp | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp
index b1d3ac2245f..f58aab30800 100644
--- a/indra/newview/llpanelvolume.cpp
+++ b/indra/newview/llpanelvolume.cpp
@@ -764,7 +764,20 @@ void LLPanelVolume::sendIsReflectionProbe()
     }
     else
     {
-        LLNotificationsUtil::add("CantSelectReflectionProbe");
+        if (value)
+        {
+            LLNotificationsUtil::add("CantSelectReflectionProbe");
+        }
+        else if (objectp->flagPhantom())
+        {
+            LLViewerObject* root = objectp->getRootEdit();
+            bool in_linkeset = root != objectp || objectp->numChildren() > 0;
+            if (in_linkeset)
+            {
+                // In linkset with a phantom flag
+                objectp->setFlags(FLAGS_PHANTOM, FALSE);
+            }
+        }
         volobjp->setIsReflectionProbe(value);
     }
 }
@@ -1213,6 +1226,17 @@ void LLPanelVolume::onPasteLight()
         }
         else
         {
+            if (objectp->flagPhantom())
+            {
+                LLViewerObject* root = objectp->getRootEdit();
+                bool in_linkeset = root != objectp || objectp->numChildren() > 0;
+                if (in_linkeset)
+                {
+                    // In linkset with a phantom flag
+                    objectp->setFlags(FLAGS_PHANTOM, FALSE);
+                }
+            }
+
             volobjp->setIsReflectionProbe(false);
         }
     }
-- 
GitLab