From 30658d310c4dc9cb3b779ff0544daff68760ee1e Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Tue, 20 Dec 2022 12:13:29 -0500
Subject: [PATCH] Fix hot settings

---
 indra/newview/llavataractions.cpp | 8 +++++---
 indra/newview/lldrawpoolwater.cpp | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index ff50b19d221..5dab1cc4d0c 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -431,7 +431,7 @@ void LLAvatarActions::showPick(const LLUUID& avatar_id, const LLUUID& pick_id)
         {
             const LLFloaterProfileLegacy* profile = LLFloaterReg::showTypedInstance<LLFloaterProfileLegacy>(
                 "legacy_profile", LLSD().with("avatar_id", avatar_id), TAKE_FOCUS_YES);
-            auto* tab = dynamic_cast<LLPanelProfileLegacy::LLPanelProfilePicks*>(profile->expandTab("avatar_picks_tab"));
+            /*auto* tab = */dynamic_cast<LLPanelProfileLegacy::LLPanelProfilePicks*>(profile->expandTab("avatar_picks_tab"));
 			// *TODO: Finish
         }
         else
@@ -477,7 +477,8 @@ bool LLAvatarActions::isPickTabSelected(const LLUUID& avatar_id)
 {
     if (avatar_id.notNull())
     {
-        if (gSkinSettings.getBool("LegacyProfile"))
+		static LLCachedControl<bool> legacy_profile(gSkinSettings, "LegacyProfile");
+        if (legacy_profile)
         {
             const LLFloaterProfileLegacy* profile = LLFloaterReg::findTypedInstance<LLFloaterProfileLegacy>(
 				"legacy_profile", LLSD().with("avatar_id", avatar_id));
@@ -578,7 +579,8 @@ bool LLAvatarActions::profileVisible(const LLUUID& avatar_id)
 LLFloater* LLAvatarActions::findProfileFloater(const LLUUID& avatar_id)
 {
     LLFloater* profile = nullptr;
-    if (gSkinSettings.getBool("LegacyProfile"))
+	static LLCachedControl<bool> legacy_profile(gSkinSettings, "LegacyProfile");
+    if (legacy_profile)
         profile = LLFloaterReg::findTypedInstance<LLFloaterProfileLegacy>("legacy_profile", LLSD().with("avatar_id", avatar_id));
     else
         profile = LLFloaterReg::findTypedInstance<LLFloaterProfile>("profile", LLSD().with("id", avatar_id));
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index 16af560bcee..a65cd28611c 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -474,6 +474,7 @@ void LLDrawPoolWater::renderWater()
     LLColor3 light_diffuse(0, 0, 0);
 //    F32      light_exp = 0.0f;
 
+	static LLCachedControl<bool> has_normal_mips(gSavedSettings, "RenderWaterMipNormal");
 	LLEnvironment& environment = LLEnvironment::instance();
 	LLViewerCamera& viewerCamera = LLViewerCamera::instance();
 	const LLSettingsWater::ptr_t& pwater = environment.getCurrentWater();
@@ -481,7 +482,6 @@ void LLDrawPoolWater::renderWater()
     LLVector3              light_dir       = environment.getLightDirection();
     bool                   sun_up          = environment.getIsSunUp();
     bool                   moon_up         = environment.getIsMoonUp();
-    bool                   has_normal_mips = gSavedSettings.getBOOL("RenderWaterMipNormal");
     bool                   underwater      = viewerCamera.cameraUnderWater();
 
     if (sun_up)
-- 
GitLab