summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp11
-rw-r--r--indra/newview/llfloaterfixedenvironment.cpp18
2 files changed, 27 insertions, 2 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 3d03409fe9..fa16648140 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -278,8 +278,6 @@ void LLFloaterEditExtDayCycle::onOpen(const LLSD& key)
}
else
{
- mInventoryItem = nullptr;
- mInventoryId.setNull();
mCanCopy = true;
mCanMod = true;
mMakeNoTrans = false;
@@ -450,6 +448,8 @@ void LLFloaterEditExtDayCycle::setEditDayCycle(const LLSettingsDay::ptr_t &pday)
void LLFloaterEditExtDayCycle::setEditDefaultDayCycle()
{
+ mInventoryItem = nullptr;
+ mInventoryId.setNull();
LLSettingsVOBase::getSettingsAsset(LLSettingsDay::GetDefaultAssetId(),
[this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); });
}
@@ -1066,6 +1066,13 @@ void LLFloaterEditExtDayCycle::loadInventoryItem(const LLUUID &inventoryId)
void LLFloaterEditExtDayCycle::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status)
{
+ if ((mInventoryItem && mInventoryItem->getAssetUUID() != asset_id)
+ || (!mInventoryItem && LLSettingsDay::GetDefaultAssetId() != asset_id))
+ {
+ LL_WARNS("ENVDAYEDIT") << "Discarding obsolete asset callback" << LL_ENDL;
+ return;
+ }
+
if (!settings || status)
{
LLSD args;
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index 9831a5fa84..d65a578a6d 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -292,12 +292,30 @@ void LLFloaterFixedEnvironment::checkAndConfirmSettingsLoss(LLFloaterFixedEnviro
void LLFloaterFixedEnvironment::onPickerCommitSetting(LLUUID asset_id)
{
+ mInventoryItem = NULL;
+ mInventoryId.setNull();
+ if (!mInventoryFloater.isDead())
+ {
+ LLFloaterSettingsPicker *picker = static_cast<LLFloaterSettingsPicker *>(mInventoryFloater.get());
+ if (picker)
+ {
+ mInventoryId = picker->findItemID(asset_id, false);
+ mInventoryItem = gInventory.getItem(mInventoryId);
+ }
+ }
+
LLSettingsVOBase::getSettingsAsset(asset_id,
[this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); });
}
void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status)
{
+ if (mInventoryItem && mInventoryItem->getAssetUUID() != asset_id)
+ {
+ LL_WARNS("ENVIRONMENT") << "Discarding obsolete asset callback" << LL_ENDL;
+ return;
+ }
+
if (!settings || status)
{
LLSD args;