From faa0f3696465a1e3ab80a277d0aad09c0775e450 Mon Sep 17 00:00:00 2001
From: Cosmic Linden <cosmic@lindenlab.com>
Date: Fri, 15 Mar 2024 16:19:42 -0700
Subject: [PATCH] secondlife/viewer#1006: Don't send terrain update if
 validation fails

---
 indra/newview/llfloaterregioninfo.cpp | 31 ++++++++++++++-------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 5de11d66999..084ff988514 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -1633,21 +1633,6 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region)
 BOOL LLPanelRegionTerrainInfo::sendUpdate()
 {
 	LL_INFOS() << "LLPanelRegionTerrainInfo::sendUpdate" << LL_ENDL;
-	std::string buffer;
-	strings_t strings;
-	LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
-
-	// update the model
-	LLRegionInfoModel& region_info = LLRegionInfoModel::instance();
-	region_info.mWaterHeight = (F32) getChild<LLUICtrl>("water_height_spin")->getValue().asReal();
-	region_info.mTerrainRaiseLimit = (F32) getChild<LLUICtrl>("terrain_raise_spin")->getValue().asReal();
-	region_info.mTerrainLowerLimit = (F32) getChild<LLUICtrl>("terrain_lower_spin")->getValue().asReal();
-
-	// and sync the region with it
-	region_info.sendRegionTerrain(invoice);
-	
-	// =======================================
-	// Assemble and send texturedetail message
 
 	// Make sure user hasn't chosen wacky textures.
 	if (!validateTextureSizes())
@@ -1670,6 +1655,22 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate()
 		}
 	}
 
+    std::string buffer;
+    strings_t strings;
+    LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
+
+    // update the model
+    LLRegionInfoModel& region_info = LLRegionInfoModel::instance();
+    region_info.mWaterHeight = (F32) getChild<LLUICtrl>("water_height_spin")->getValue().asReal();
+    region_info.mTerrainRaiseLimit = (F32) getChild<LLUICtrl>("terrain_raise_spin")->getValue().asReal();
+    region_info.mTerrainLowerLimit = (F32) getChild<LLUICtrl>("terrain_lower_spin")->getValue().asReal();
+
+    // and sync the region with it
+    region_info.sendRegionTerrain(invoice);
+
+    // =======================================
+    // Assemble and send texturedetail message
+
 	std::string id_str;
 	LLMessageSystem* msg = gMessageSystem;
 
-- 
GitLab