diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llenvironment.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llpanelenvironment.cpp | 16 |
2 files changed, 5 insertions, 12 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 722c565300..05bd704556 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -2087,7 +2087,6 @@ void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, S32 track_no, UpdateInf body[KEY_ENVIRONMENT][KEY_DAYLENGTH] = updates->mDayLength; } - // server only allows positive values if (updates->mDayOffset > 0) { body[KEY_ENVIRONMENT][KEY_DAYOFFSET] = updates->mDayOffset; diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index 7dd9f6e86e..be61c44b7c 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -287,8 +287,8 @@ void LLPanelEnvironmentInfo::refresh() F32Hours daylength(mCurrentEnvironment->mDayLength); F32Hours dayoffset(mCurrentEnvironment->mDayOffset); - while (dayoffset.value() >= daylength.value()) - dayoffset -= daylength; + if (dayoffset.value() > 12.0f) + dayoffset -= F32Hours(24.0); mSliderDayLength->setValue(daylength.value()); mSliderDayOffset->setValue(dayoffset.value()); @@ -717,11 +717,6 @@ void LLPanelEnvironmentInfo::onSldDayLengthChanged(F32 value) F32Hours daylength(value); mCurrentEnvironment->mDayLength = daylength; - F32 offset = (F32)mSliderDayOffset->getValue().asReal(); - if (offset <= 0.0f) - { - onSldDayOffsetChanged(offset); - } setDirtyFlag(DIRTY_FLAG_DAYLENGTH); udpateApparentTimeOfDay(); @@ -734,9 +729,8 @@ void LLPanelEnvironmentInfo::onSldDayOffsetChanged(F32 value) { F32Hours dayoffset(value); - // server only allows positive values - while (dayoffset.value() <= 0.0f) - dayoffset += mCurrentEnvironment->mDayLength; + if (dayoffset.value() <= 0.0f) + dayoffset += F32Hours(24.0); mCurrentEnvironment->mDayOffset = dayoffset; setDirtyFlag(DIRTY_FLAG_DAYOFFSET); @@ -928,7 +922,7 @@ void LLPanelEnvironmentInfo::udpateApparentTimeOfDay() { static const F32 SECONDSINDAY(24.0 * 60.0 * 60.0); - if ((!mCurrentEnvironment) || (mCurrentEnvironment->mDayLength.value() < 1.0)) + if ((!mCurrentEnvironment) || (mCurrentEnvironment->mDayLength.value() < 1.0) || (mCurrentEnvironment->mDayOffset.value() < 1.0)) { mLabelApparentTime->setVisible(false); return; |