summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelenvironment.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-08-20 16:26:54 -0700
committerRider Linden <rider@lindenlab.com>2018-08-20 16:26:54 -0700
commitb2b3c36bda988be4b433e9f97f13bc1c67722eb7 (patch)
tree877dfa7e15d2dd5daf7816854cbce3c1797eb13f /indra/newview/llpanelenvironment.cpp
parent8fc3956a5eeaa2dffabdcda60800d9c4d4e49c43 (diff)
Didn't get a fix from last week, and divide by zeros are bad.
Diffstat (limited to 'indra/newview/llpanelenvironment.cpp')
-rw-r--r--indra/newview/llpanelenvironment.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index 5bdd2ecff8..e52863c6ef 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -326,7 +326,7 @@ void LLPanelEnvironmentInfo::onBtnEdit()
LLFloaterEditExtDayCycle *dayeditor = getEditFloater();
- LLSD params(LLSDMap(LLFloaterEditExtDayCycle::KEY_EDIT_CONTEXT, (mCurrentParcelId == INVALID_PARCEL_ID) ? LLFloaterEditExtDayCycle::CONTEXT_REGION : LLFloaterEditExtDayCycle::CONTEXT_PARCEL)
+ LLSD params(LLSDMap(LLFloaterEditExtDayCycle::KEY_EDIT_CONTEXT, (mCurrentParcelId == INVALID_PARCEL_ID) ? LLFloaterEditExtDayCycle::VALUE_CONTEXT_REGION : LLFloaterEditExtDayCycle::VALUE_CONTEXT_REGION)
(LLFloaterEditExtDayCycle::KEY_DAY_LENGTH, mCurrentEnvironment ? (S32)(mCurrentEnvironment->mDayLength.value()) : FOURHOURS));
dayeditor->openFloater(params);
@@ -382,8 +382,12 @@ void LLPanelEnvironmentInfo::udpateApparentTimeOfDay()
{
static const F32 SECONDSINDAY(24.0 * 60.0 * 60.0);
- if (!mCurrentEnvironment)
+ if ((!mCurrentEnvironment) || (mCurrentEnvironment->mDayLength.value() < 1.0) || (mCurrentEnvironment->mDayOffset.value() < 1.0))
+ {
+ getChild<LLUICtrl>(LBL_TIMEOFDAY)->setVisible(false);
return;
+ }
+ getChild<LLUICtrl>(LBL_TIMEOFDAY)->setVisible(true);
S32Seconds now(LLDate::now().secondsSinceEpoch());