Skip to content

Commit e3fbcaa

Browse files
Merge pull request #3129 from secondlife/leviathan/anti-parcel-damage
prevent erroneous edit of wrong parcel
2 parents 675dbd7 + 2443109 commit e3fbcaa

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

indra/llinventory/llparcel.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ class LLParcel
262262

263263
void setMediaURLResetTimer(F32 time);
264264
virtual void setLocalID(S32 local_id);
265+
void setRegionID(const LLUUID& id) { mRegionID = id; }
266+
const LLUUID& getRegionID() const { return mRegionID; }
265267

266268
// blow away all the extra stuff lurking in parcels, including urls, access lists, etc
267269
void clearParcel();
@@ -651,6 +653,7 @@ class LLParcel
651653
S32 mLocalID;
652654
LLUUID mBanListTransactionID;
653655
LLUUID mAccessListTransactionID;
656+
LLUUID mRegionID;
654657
std::map<LLUUID,LLAccessEntry> mAccessList;
655658
std::map<LLUUID,LLAccessEntry> mBanList;
656659
std::map<LLUUID,LLAccessEntry> mTempBanList;

indra/newview/llviewerparcelmgr.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,12 +1327,12 @@ const S32 LLViewerParcelMgr::getAgentParcelId() const
13271327
return INVALID_PARCEL_ID;
13281328
}
13291329

1330-
void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_agent_region)
1330+
void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel)
13311331
{
13321332
if(!parcel)
13331333
return;
13341334

1335-
LLViewerRegion *region = use_agent_region ? gAgent.getRegion() : LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth );
1335+
LLViewerRegion *region = LLWorld::getInstance()->getRegionFromID(parcel->getRegionID());
13361336
if (!region)
13371337
return;
13381338

@@ -1676,10 +1676,16 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
16761676
// Actually extract the data.
16771677
if (parcel)
16781678
{
1679+
// store region_id in the parcel so we can find it again later
1680+
LLViewerRegion* parcel_region = LLWorld::getInstance()->getRegion(msg->getSender());
1681+
if (parcel_region)
1682+
{
1683+
parcel->setRegionID(parcel_region->getRegionID());
1684+
}
1685+
16791686
if (local_id == parcel_mgr.mAgentParcel->getLocalID())
16801687
{
16811688
// Parcels in different regions can have same ids.
1682-
LLViewerRegion* parcel_region = LLWorld::getInstance()->getRegion(msg->getSender());
16831689
LLViewerRegion* agent_region = gAgent.getRegion();
16841690
if (parcel_region && agent_region && parcel_region->getRegionID() == agent_region->getRegionID())
16851691
{

indra/newview/llviewerparcelmgr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class LLViewerParcelMgr : public LLSingleton<LLViewerParcelMgr>
219219
// containing the southwest corner of the selection.
220220
// If want_reply_to_update, simulator will send back a ParcelProperties
221221
// message.
222-
void sendParcelPropertiesUpdate(LLParcel* parcel, bool use_agent_region = false);
222+
void sendParcelPropertiesUpdate(LLParcel* parcel);
223223

224224
// Takes an Access List flag, like AL_ACCESS or AL_BAN
225225
void sendParcelAccessListUpdate(U32 which);

0 commit comments

Comments
 (0)