From b328c7384e46425e43aadb817bd794065ae1830c Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 26 Sep 2018 16:54:01 -0700 Subject: 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. --- indra/newview/llfloatereditextdaycycle.cpp | 10 ++++++++++ indra/newview/llfloatereditextdaycycle.h | 2 ++ indra/newview/llfloaterland.cpp | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) 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& parcelp); - virtual bool isRegion() const override { return false; } + virtual bool isRegion() const override { return true; } virtual BOOL postBuild() override; virtual void refresh() override; -- cgit v1.2.3