summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatereditextdaycycle.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-09-26 16:54:01 -0700
committerRider Linden <rider@lindenlab.com>2018-09-26 16:54:01 -0700
commitb328c7384e46425e43aadb817bd794065ae1830c (patch)
treef81aaa843e7fa2d4ecd921a3e21a12c39c361aad /indra/newview/llfloatereditextdaycycle.cpp
parent78866b33a9f3a44db11a18245e8a37c834297a46 (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/llfloatereditextdaycycle.cpp')
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp10
1 files changed, 10 insertions, 0 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))
{