diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-09-24 18:31:48 +0300 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-09-24 19:34:13 +0300 |
commit | 86446c7b55c4265b3dd90919e4d1cd4a4d30ea6a (patch) | |
tree | 4d9ab3182e9009a9a8608f2e5642f87491c13d38 /indra/newview/llpanelenvironment.cpp | |
parent | 5eab13589284f1044bae7303d68bc2752f304a97 (diff) |
viewer#2648 Fix issues with day offset value
Diffstat (limited to 'indra/newview/llpanelenvironment.cpp')
-rw-r--r-- | indra/newview/llpanelenvironment.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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; |