diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llenvironment.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llpanelenvironment.cpp | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 05bd704556..722c565300 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -2087,6 +2087,7 @@ 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 423ca376d1..7dd9f6e86e 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -287,7 +287,7 @@ void LLPanelEnvironmentInfo::refresh() F32Hours daylength(mCurrentEnvironment->mDayLength); F32Hours dayoffset(mCurrentEnvironment->mDayOffset); - if (dayoffset.value() > 12.0f) + while (dayoffset.value() >= daylength.value()) dayoffset -= daylength; mSliderDayLength->setValue(daylength.value()); @@ -734,8 +734,8 @@ void LLPanelEnvironmentInfo::onSldDayOffsetChanged(F32 value) { F32Hours dayoffset(value); - if (dayoffset.value() <= 0.0f) - // if day cycle is 5 hours long, we want -1h offset to result in 4h + // server only allows positive values + while (dayoffset.value() <= 0.0f) dayoffset += mCurrentEnvironment->mDayLength; mCurrentEnvironment->mDayOffset = dayoffset; |