From 423df2ba4b731417796478c449e3e8f3d166ef21 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 21 Mar 2025 07:18:13 -0700 Subject: prevent erroneous edit of wrong parcel (#3759) * prevent erroneous edit of wrong parcel Fixes jira-archive-internal/issues/70771 [SL-20409] Erroneous Local Parcel Twins - Parcel Updates Across Region Borders - unrequested updateDatabaseParcel changes * remove unused argument in sendParcelPropertiesUpdate() --- indra/newview/llviewerparcelmgr.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewerparcelmgr.cpp') diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 8e6657b4b9..1a5c40064a 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1327,12 +1327,12 @@ const S32 LLViewerParcelMgr::getAgentParcelId() const return INVALID_PARCEL_ID; } -void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_agent_region) +void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel) { if(!parcel) return; - LLViewerRegion *region = use_agent_region ? gAgent.getRegion() : LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); + LLViewerRegion *region = LLWorld::getInstance()->getRegionFromID(parcel->getRegionID()); if (!region) return; @@ -1676,10 +1676,16 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use // Actually extract the data. if (parcel) { + // store region_id in the parcel so we can find it again later + LLViewerRegion* parcel_region = LLWorld::getInstance()->getRegion(msg->getSender()); + if (parcel_region) + { + parcel->setRegionID(parcel_region->getRegionID()); + } + if (local_id == parcel_mgr.mAgentParcel->getLocalID()) { // Parcels in different regions can have same ids. - LLViewerRegion* parcel_region = LLWorld::getInstance()->getRegion(msg->getSender()); LLViewerRegion* agent_region = gAgent.getRegion(); if (parcel_region && agent_region && parcel_region->getRegionID() == agent_region->getRegionID()) { -- cgit v1.2.3