diff options
author | Rider Linden <rider@lindenlab.com> | 2018-09-26 16:54:01 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-09-26 16:54:01 -0700 |
commit | b328c7384e46425e43aadb817bd794065ae1830c (patch) | |
tree | f81aaa843e7fa2d4ecd921a3e21a12c39c361aad /indra/newview | |
parent | 78866b33a9f3a44db11a18245e8a37c834297a46 (diff) |
SL-9679: Record the asset id that the editor is expecting. If none set to null. If asset id recieved does not match expected throw it away.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.h | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterland.cpp | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index fac0ddc27b..b9e9bf768e 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -436,6 +436,7 @@ void LLFloaterEditExtDayCycle::refresh() void LLFloaterEditExtDayCycle::setEditDayCycle(const LLSettingsDay::ptr_t &pday) { + mExpectingAssetId.setNull(); mEditDay = pday->buildDeepCloneAndUncompress(); if (mEditDay->isTrackEmpty(LLSettingsDay::TRACK_WATER)) @@ -463,6 +464,7 @@ void LLFloaterEditExtDayCycle::setEditDefaultDayCycle() { mInventoryItem = nullptr; mInventoryId.setNull(); + mExpectingAssetId = LLSettingsDay::GetDefaultAssetId(); LLSettingsVOBase::getSettingsAsset(LLSettingsDay::GetDefaultAssetId(), [this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); }); } @@ -1086,12 +1088,20 @@ void LLFloaterEditExtDayCycle::loadInventoryItem(const LLUUID &inventoryId) mCanCopy = mInventoryItem->getPermissions().allowCopyBy(gAgent.getID()); mCanMod = mInventoryItem->getPermissions().allowModifyBy(gAgent.getID()); + mExpectingAssetId = mInventoryItem->getAssetUUID(); LLSettingsVOBase::getSettingsAsset(mInventoryItem->getAssetUUID(), [this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); }); } void LLFloaterEditExtDayCycle::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status) { + if (asset_id != mExpectingAssetId) + { + LL_WARNS("ENVDAYEDIT") << "Expecting {" << mExpectingAssetId << "} got {" << asset_id << "} - throwing away." << LL_ENDL; + return; + } + mExpectingAssetId.setNull(); + if ((mInventoryItem && mInventoryItem->getAssetUUID() != asset_id) || (!mInventoryItem && LLSettingsDay::GetDefaultAssetId() != asset_id)) { diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h index 1e40a9dc6e..0d306961df 100644 --- a/indra/newview/llfloatereditextdaycycle.h +++ b/indra/newview/llfloatereditextdaycycle.h @@ -177,6 +177,8 @@ private: std::string mLastFrameSlider; bool mShiftCopyEnabled; + LLUUID mExpectingAssetId; + LLButton* mAddFrameButton; LLButton* mDeleteFrameButton; LLButton* mImportButton; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 1147f54853..f90b188fde 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -147,7 +147,7 @@ class LLPanelLandEnvironment public: LLPanelLandEnvironment(LLSafeHandle<LLParcelSelection>& parcelp); - virtual bool isRegion() const override { return false; } + virtual bool isRegion() const override { return true; } virtual BOOL postBuild() override; virtual void refresh() override; |