diff options
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llfloaterfixedenvironment.cpp | 20 |
2 files changed, 34 insertions, 4 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index fa16648140..3531e9c4e8 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -1260,11 +1260,25 @@ void LLFloaterEditExtDayCycle::doApplyEnvironment(const std::string &where, cons return; } - LLEnvironment::instance().updateParcel(parcel->getLocalID(), day, -1, -1); + if (mInventoryItem && !isDirty()) + { + LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), -1, -1); + } + else + { + LLEnvironment::instance().updateParcel(parcel->getLocalID(), day, -1, -1); + } } else if (where == ACTION_APPLY_REGION) { - LLEnvironment::instance().updateRegion(day, -1, -1); + if (mInventoryItem && !isDirty()) + { + LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), -1, -1); + } + else + { + LLEnvironment::instance().updateRegion(day, -1, -1); + } } else { diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index d65a578a6d..2eda405f51 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -430,17 +430,33 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) return; } - if (mSettings->getSettingsType() == "sky") + if (mInventoryItem && !isDirty()) + { + LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), -1, -1); + } + else if (mSettings->getSettingsType() == "sky") + { LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast<LLSettingsSky>(mSettings), -1, -1); + } else if (mSettings->getSettingsType() == "water") + { LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast<LLSettingsWater>(mSettings), -1, -1); + } } else if (where == ACTION_APPLY_REGION) { - if (mSettings->getSettingsType() == "sky") + if (mInventoryItem && !isDirty()) + { + LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), -1, -1); + } + else if (mSettings->getSettingsType() == "sky") + { LLEnvironment::instance().updateRegion(std::static_pointer_cast<LLSettingsSky>(mSettings), -1, -1); + } else if (mSettings->getSettingsType() == "water") + { LLEnvironment::instance().updateRegion(std::static_pointer_cast<LLSettingsWater>(mSettings), -1, -1); + } } else { |