summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatereditextdaycycle.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-09-18 18:17:54 +0000
committerRider Linden <rider@lindenlab.com>2018-09-18 18:17:54 +0000
commitc5283f63ab6571a3f48f30cc4eb2dbab3f0633ce (patch)
tree0719cb299fe3713c4aa7acfa834ae0bba49655ec /indra/newview/llfloatereditextdaycycle.cpp
parente53d35f4e8c9e15eda75f960b253481e1447b2b1 (diff)
parent89c48daf35ba1499100cdf81e07a91a75eea63c8 (diff)
Merged in andreykproductengine/maint-eep (pull request #94)
SL-9670 and SL-9678 Approved-by: Maxim Nikolenko <maximnproductengine@lindenlab.com>
Diffstat (limited to 'indra/newview/llfloatereditextdaycycle.cpp')
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 4be0e30c62..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;
@@ -1085,6 +1092,9 @@ void LLFloaterEditExtDayCycle::onAssetLoaded(LLUUID asset_id, LLSettingsBase::pt
else
settings->setFlag(LLSettingsBase::FLAG_NOMOD);
+ if (mInventoryItem)
+ settings->setName(mInventoryItem->getName());
+
setEditDayCycle(std::dynamic_pointer_cast<LLSettingsDay>(settings));
}