Chat spheres: use established code convention for checking if setting is enabled

Signed-off-by: PanteraPolnocy <panterapolnocy@gmail.com>
master
PanteraPolnocy 2025-12-13 19:39:44 +01:00
parent 57e284042c
commit 6c4445b04b
1 changed files with 6 additions and 3 deletions

View File

@ -1801,8 +1801,7 @@ static void renderChatRangeSphere(const LLVector3& center, F32 radius, const LLC
static void drawChatRangeSpheres() static void drawChatRangeSpheres()
{ {
static LLCachedControl<bool> show_spheres(gSavedSettings, "FSShowChatRangeSpheres", false); if (!isAgentAvatarValid())
if (!show_spheres() || !isAgentAvatarValid())
{ {
return; return;
} }
@ -1855,7 +1854,11 @@ void render_ui_3d()
} }
// <FS:PP> Render chat range spheres in 3D world // <FS:PP> Render chat range spheres in 3D world
static LLCachedControl<bool> show_spheres(gSavedSettings, "FSShowChatRangeSpheres", false);
if (show_spheres())
{
drawChatRangeSpheres(); drawChatRangeSpheres();
}
// </FS:PP> // </FS:PP>
gViewerWindow->renderSelections(false, false, true); // Non HUD call in render_hud_elements gViewerWindow->renderSelections(false, false, true); // Non HUD call in render_hud_elements